Note
This page is work in progress...
Contents
For examples of using this module see Getting Started with ptypes.
Bases: ptypes.storage.AssignedByReference
A structure is like a mutable named tuple.
Structures are usable as hash keys (they are hashable), but prepare for surprises if you do so and change the contents of the structure after initialisation.
Structures lack the ‘greater than / less than’ relational operators, so they are not usable as keys in skip lists.
Structures can be compared for (non-)equality. They are compared field-by-field, accessing via getattr(). Extra fields on the compared-to-object are ignored.
Accessing the contents attribute of a structure instance will return a named tuple. Assigning to the attribute will set the contents of the structure to the assigned value, which must have at least the attributes the structure has fields.
Bases: object
Base class for all the proxy classes for persistent objects.
Read-only property giving a tuple uniquely identifies the object.
Compare the identity of Persistent instances.
Note that the is operator compares the identity of the proxy objects, not that of the persistent objects they refer to.
Parameters: |
|
---|---|
Returns: | True if self refers to the same persistent object as other, otherwise False. |
For examples of using this module see Declarative Queries.
Bases: ptypes.query.BindingRule
Bind the value of an attribute of an object to the name of the rule.
Bases: ptypes.query.BindingRule
Bind an interned constant value to the name of the rule.
Bases: ptypes.query.BindingRule
Bind the contents of a node to the name of the rule.
Bases: ptypes.query.BindingRule
Bind the next value in a hash index to the name of the rule.
Bases: ptypes.query.BindingRule
Bind the interned value of a query parameter to the name of the rule.
Bases: object
Selects combinations of persistent objects.
Each selected combination is sent to a generator.
Treat this as an abstract base class and define your queries in subclasses derived from this. Specify the binding rules in the body of the class and override the processOne() method.
A generator to which the query context is repeatedly sent.
Whenever the query context reaches a state matching all the binding rules, it is sent to this generator.
This generator method can be overridden in derived classes. The default implementation prints a header and trailer and in between the context every time it receives it.
Bases: ptypes.query.BindingRule
Bind the result of a comparison to the name of the rule.
For examples of using this module see Persistent Collections.
Bases: ptypes.query.BindingRule
Bind the next value in a skip-list to the name of the variable.
For examples of using this module see Property Graphs.
Bases: ptypes.query.BindingRule
Bind the value of an attribute of a node to the name of the variable.
Bases: ptypes.query.BindingRule
Bind the contents of a node to the name of the variable.
For examples of using this module see Persistent Buffers.