library Package¶
library
Package¶
arithmetic
Module¶
-
class
contracts.library.arithmetic.
Binary
(exprs, glyph, where=None)[source]¶ Bases:
contracts.interface.RValue
-
operations
= {'+': <function <lambda>>, '*': <function <lambda>>, '-': <function <lambda>>, '^': <function <lambda>>}¶
-
precedence
= {'+': 0, '*': 1, '-': 0, '^': 2}¶
-
array
Module¶
-
class
contracts.library.array.
Array
(shape_contract=None, elements_contract=None, where=None)[source]¶ Bases:
contracts.interface.Contract
-
class
contracts.library.array.
Shape
(length, contract, where=None)[source]¶ Bases:
contracts.interface.Contract
-
class
contracts.library.array.
ShapeContract
(dimensions, ellipsis=False, where=None)[source]¶ Bases:
contracts.interface.Contract
array_ops
Module¶
-
class
contracts.library.array_ops.
ArrayConstraint
(glyph, rvalue, where=None)[source]¶ Bases:
contracts.library.array_ops.ArrayElementsTest
Comparisons for numpy array elements. They check that the condition is respected for all the entries in the array.
-
constraints
= {'>=': <function <lambda>>, '==': <function <lambda>>, '=': <function <lambda>>, '<=': <function <lambda>>, '!=': <function <lambda>>, '<': <function <lambda>>, '>': <function <lambda>>}¶
-
-
class
contracts.library.array_ops.
ArrayElementsTest
(where)[source]¶ Bases:
contracts.interface.Contract
comparison
Module¶
-
class
contracts.library.comparison.
CheckOrder
(expr1, glyph, expr2, where=None)[source]¶ Bases:
contracts.interface.Contract
-
conditions
= {'>=': (False, True, True), '==': (False, True, False), '=': (False, True, False), '<=': (True, True, False), '!=': (True, False, True), '<': (True, False, False), '>': (False, False, True)}¶
-
compositions
Module¶
-
class
contracts.library.compositions.
And
(clauses, where=None)[source]¶ Bases:
contracts.library.compositions.Logical
,contracts.interface.Contract
-
class
contracts.library.compositions.
Not
(clauses, where=None)[source]¶ Bases:
contracts.library.compositions.Logical
,contracts.interface.Contract
-
class
contracts.library.compositions.
OR
(clauses, where=None)[source]¶ Bases:
contracts.library.compositions.Logical
,contracts.interface.Contract
dicts
Module¶
dummy
Module¶
-
class
contracts.library.dummy.
Any
(where=None)[source]¶ Bases:
contracts.interface.Contract
Always true.
extensions
Module¶
-
class
contracts.library.extensions.
CheckCallable
(callable)[source]¶ Bases:
contracts.interface.Contract
-
class
contracts.library.extensions.
CheckCallableWithSelf
(callable)[source]¶ Bases:
contracts.interface.Contract
-
class
contracts.library.extensions.
Extension
(identifier, where=None, args=(), kwargs=None)[source]¶ Bases:
contracts.interface.Contract
-
registrar
= {'Container': CheckCallable(<function f>), 'int': SeparateContext(OR([CheckType(int,'Int'), Extension('np_scalar_int'), And([Extension('np_scalar'), Array(None,ArrayOR([DType(dtype('int8'),'i1'), DType(dtype('int8')), DType(dtype('int16')), DType(dtype('int32')), DType(dtype('int64'))]))])])), 'MutableMapping': CheckCallable(<function f>), 'float': SeparateContext(OR([CheckType(float,'Float'), Extension('np_scalar_float'), And([Extension('np_scalar'), Array(None,ArrayOR([DType(dtype('float32')), DType(dtype('float64'))]))])])), 'np_zeroshape_array': CheckCallable(<function np_zeroshape_array>), 'np_scalar_uint': SeparateContext(OR([CheckType(uint8,'np_uint8'), CheckType(uint16,'np_uint16'), CheckType(uint32,'np_uint32'), CheckType(uint64,'np_uint64')])), 'Mapping': CheckCallable(<function f>), 'Callable': CheckCallable(<function f>), 'np_scalar_float': SeparateContext(OR([CheckType(float32,'np_float32'), CheckType(float64,'np_float64')])), 'finite': CheckCallable(<function finite>), 'Hashable': CheckCallable(<function f>), 'None': CheckCallable(<function is_None>), 'MutableSet': CheckCallable(<function f>), 'np_scalar_type': SeparateContext(OR([Extension('np_scalar_int'), Extension('np_scalar_uint'), Extension('np_scalar_float')])), 'MutableSequence': CheckCallable(<function f>), 'number': SeparateContext(OR([Extension('float'), Extension('int'), Extension('uint')])), 'Sized': CheckCallable(<function f>), 'uint': SeparateContext(OR([Extension('np_scalar_uint'), And([Extension('np_scalar'), Array(None,ArrayOR([DType(dtype('uint8'),'u1'), DType(dtype('uint8')), DType(dtype('uint16')), DType(dtype('uint32')), DType(dtype('uint64'))]))])])), 'Set': CheckCallable(<function f>), 'Iterator': CheckCallable(<function f>), 'Sequence': CheckCallable(<function f>), 'np_scalar': SeparateContext(OR([Extension('np_zeroshape_array'), Extension('np_scalar_type')])), 'Iterable': CheckCallable(<function f>), 'np_scalar_int': SeparateContext(OR([CheckType(int8,'np_int8'), CheckType(int16,'np_int16'), CheckType(int32,'np_int32'), CheckType(int64,'np_int64')])), 'NoneType': CheckCallable(<function is_None>)}¶
-
lists
Module¶
map
Module¶
miscellaneous_aliases
Module¶
separate_context
Module¶
seq
Module¶
simple_values
Module¶
-
class
contracts.library.simple_values.
EqualTo
(rvalue, where=None)[source]¶ Bases:
contracts.interface.Contract
-
class
contracts.library.simple_values.
SimpleRValue
(value, representation=None, where=None)[source]¶ Bases:
contracts.interface.RValue
strings
Module¶
-
class
contracts.library.strings.
String
(length=None, where=None)[source]¶ Bases:
contracts.library.strings.StringBase
-
DESCRIPTION
= 'an ANSI or Unicode string'¶
-
KEYWORDS
= ['string']¶
-
TYPE
¶ alias of
basestring
-
suggester
Module¶
-
contracts.library.suggester.
create_suggester
(get_options, get_message=<function default_message>, pattern=None)[source]¶
tuple
Module¶
types_misc
Module¶
-
class
contracts.library.types_misc.
CheckType
(types, type_string=None, where=None)[source]¶ Bases:
contracts.interface.Contract
variables
Module¶
-
class
contracts.library.variables.
BindVariable
(variable, allowed_types, where=None)[source]¶ Bases:
contracts.interface.Contract