| |
- __builtin__.object
-
- StaticType
-
- All
- And
- Any
- Everything
- Field
- Is
- Iterable
- Not
- Or
- Positional
- Sequence
- Type
- exceptions.Exception(exceptions.BaseException)
-
- InternalError
- StaticTypeError
- TypeFormatError
class All(StaticType) |
|
A static type that matches a value if that particular value is iterable
and all of its values match the component type with which this All
instance was created. The type is stored in a field named component_type. |
|
- Method resolution order:
- All
- StaticType
- __builtin__.object
Methods defined here:
- __init__(self, component_type)
- __str__(self)
- matches(self, value)
Methods inherited from StaticType:
- __repr__(self)
- check_matches(self, value)
- Calls matches(value). If the reslt is false, a StaticTypeError is
raised. If the result is true, this method simply returns.
Data descriptors inherited from StaticType:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Any(StaticType) |
|
A static type that matches a value if that particular value is iterable
and any of its values match the component type with which this All
instance was created. The type is stored in a field named component_type. |
|
- Method resolution order:
- Any
- StaticType
- __builtin__.object
Methods defined here:
- __init__(self, component_type)
- __str__(self)
- matches(self, value)
Methods inherited from StaticType:
- __repr__(self)
- check_matches(self, value)
- Calls matches(value). If the reslt is false, a StaticTypeError is
raised. If the result is true, this method simply returns.
Data descriptors inherited from StaticType:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Field(StaticType) |
|
A static type that matches a value if that particular value has all of the
fields named when constructing this Field instance and they are all match
the type specified when constructing this Field instance. The field type
is stored in a field named field_type and the field names are stored in a
field named field_names. |
|
- Method resolution order:
- Field
- StaticType
- __builtin__.object
Methods defined here:
- __init__(self, field_type, *field_names)
- __str__(self)
- matches(self, value)
Methods inherited from StaticType:
- __repr__(self)
- check_matches(self, value)
- Calls matches(value). If the reslt is false, a StaticTypeError is
raised. If the result is true, this method simply returns.
Data descriptors inherited from StaticType:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Not(StaticType) |
|
A static type that matches a value if that particular value does not match
the construct with which this Not instance was created. The construct is
stored in a field named construct. |
|
- Method resolution order:
- Not
- StaticType
- __builtin__.object
Methods defined here:
- __init__(self, construct)
- __str__(self)
- matches(self, value)
Methods inherited from StaticType:
- __repr__(self)
- check_matches(self, value)
- Calls matches(value). If the reslt is false, a StaticTypeError is
raised. If the result is true, this method simply returns.
Data descriptors inherited from StaticType:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Or(StaticType) |
|
A static type that matches a value if any of its constructs match that
particular value. The constructs are stored in a field named constructs. |
|
- Method resolution order:
- Or
- StaticType
- __builtin__.object
Methods defined here:
- __init__(self, *constructs)
- __str__(self)
- matches(self, value)
Methods inherited from StaticType:
- __repr__(self)
- check_matches(self, value)
- Calls matches(value). If the reslt is false, a StaticTypeError is
raised. If the result is true, this method simply returns.
Data descriptors inherited from StaticType:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Positional(StaticType) |
|
A static type that matches a value if the value is a sequence, it has
exactly the same number of value as were passed to the Positional instance
when it was created, and each item matches the corresponding static type
passed to the Positional instance when it was created. For example,
Positional(int, str, bool) would match a sequence of length 3 containing
an integer, a string, and a boolean, at each respective position in the
sequence. |
|
- Method resolution order:
- Positional
- StaticType
- __builtin__.object
Methods defined here:
- __init__(self, *types)
- __str__(self)
- matches(self, value)
Methods inherited from StaticType:
- __repr__(self)
- check_matches(self, value)
- Calls matches(value). If the reslt is false, a StaticTypeError is
raised. If the result is true, this method simply returns.
Data descriptors inherited from StaticType:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class StaticType(__builtin__.object) |
|
The class that all static types extend from. It has two useful methods:
matches and check_matches.
StaticType cannot itself be instantiated; you can only construct instances
of subclasses of StaticType. |
|
Methods defined here:
- __repr__(self)
- __str__(self)
- check_matches(self, value)
- Calls matches(value). If the reslt is false, a StaticTypeError is
raised. If the result is true, this method simply returns.
- matches(self, value)
- Checks to see if the specified object matches this static type. If it
does, True will be returned, and False will be returned if it doesn't.
Subclasses of StaticType must override this to perform the actual
matching; StaticType's implementation throws an InternalError.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Type(StaticType) |
|
A static type that checks to make sure values are instances of a
particular Python type as per Python's bult-in isinstance function.
The type is stored in a field named type. |
|
- Method resolution order:
- Type
- StaticType
- __builtin__.object
Methods defined here:
- __init__(self, type)
- __str__(self)
- matches(self, value)
Methods inherited from StaticType:
- __repr__(self)
- check_matches(self, value)
- Calls matches(value). If the reslt is false, a StaticTypeError is
raised. If the result is true, this method simply returns.
Data descriptors inherited from StaticType:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
|