t.p.c.Flags(Values) : class documentation

Part of twisted.python.constants View Source View In Hierarchy

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 Method _constantFactory For FlagConstant instances with no explicitly defined value, assign the next power of two as its value.

Inherited from Values:

Class Method lookupByValue Retrieve a constant by its value or raise a ValueError if there is no constant associated with that value.

Inherited from _ConstantsContainer (via Values):

Method __new__ Classes representing constants containers are not intended to be instantiated.
Class Method lookupByName Retrieve a constant by its name or raise a ValueError if there is no constant associated with that name.
Class Method iterconstants Iteration over a Names subclass results in all of the constants it contains.
Class Variable _constantType Specified by a _ConstantsContainer subclass to specify the type of constants allowed by that subclass.
Class Variable _enumerantsInitialized A bool tracking whether _enumerants has been initialized yet or not.
Class Variable _enumerants A dict mapping the names of constants (eg NamedConstant instances) found in the class definition to those instances. This is initialized via the _EnumerantsInitializer descriptor the first time it is accessed.
Class Method _initializeEnumerants Find all of the NamedConstant instances in the definition of cls, initialize them with constant values, and build a mapping from their names to them to attach to cls.
@classmethod
def _constantFactory(cls, name, descriptor): (source)
For FlagConstant instances with no explicitly defined value, assign the next power of two as its value.
API Documentation for Twisted, generated by pydoctor at 2012-06-04 17:20:01.