t.p.constants : module documentation

Part of twisted.python View Source

Symbolic constant support, including collections and constants with text, numeric, and bit flag values.
Class NamedConstant NamedConstant defines an attribute to be a named constant within a collection defined by a Names subclass.
Class Names A Names subclass contains constants which differ only in their names and identities.
Class ValueConstant ValueConstant defines an attribute to be a named constant within a collection defined by a Values subclass.
Class Values A Values subclass contains constants which are associated with arbitrary values.
Class FlagConstant FlagConstant defines an attribute to be a flag constant within a collection defined by a Flags subclass.
Class Flags A Flags subclass contains constants which can be combined using the common bitwise operators (|, &, etc) similar to a bitvector from a language like C.
Class _Constant
Class _ConstantsContainerType _ConstantsContainerType is a metaclass for creating constants container classes.
Class _ConstantsContainer _ConstantsContainer is a class with attributes used as symbolic constants. It is up to subclasses to specify what kind of constants are allowed.
Function _flagOp Implement a binary operator for a FlagConstant instance.
def _flagOp(op, left, right): (source)
Implement a binary operator for a FlagConstant instance.
ParametersopA two-argument callable implementing the binary operation. For example, operator.or_.
leftThe left-hand FlagConstant instance.
rightThe right-hand FlagConstant instance.
ReturnsA new FlagConstant instance representing the result of the operation.
API Documentation for Twisted, generated by pydoctor at 2013-11-18 18:11:01.