FlagType

(class from pyomo.common.flags)

class pyomo.common.flags.FlagType(name, bases, dct)[source]

Bases: type

Metaclass to help generate “Flag Types”.

This is useful for defining “flag types” that are default arguments in functions so that the Sphinx-generated documentation is “cleaner”. These types are not constructable (attempts to construct the class return the class) and simplify the repr(type) and str(type).

This metaclass redefines the str() and repr() of resulting classes. The str() of the class returns only the class’ __name__, whereas the repr() returns either the qualified class name (__qualname__) if Sphinx has been imported, or else the fully-qualified class name (__module__ + '.' + __qualname__).

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

mro()

Return a type's method resolution order.

Member Documentation

mro()

Return a type’s method resolution order.