(cls, value)
return pseudo_member
Create a composite member iff value contains only members.
Create a composite member iff value contains only members.
Create a composite member iff value contains only members .
def _create_pseudo_member_(cls, value):
        """
        Create a composite member iff value contains only members.
        """
        pseudo_member = cls._value2member_map_.get(value, None)
        if pseudo_member is None:
            # verify all bits are accounted for
            _, extra_flags = _decompose(cls, value)
            if extra_flags:
                raise ValueError("%r is not a valid %s" % (value, cls.__qualname__))
            # construct a singleton enum pseudo-member
            pseudo_member = object.__new__(cls)
            pseudo_member._name_ = None
            pseudo_member._value_ = value
            # use setdefault in case another thread already created a composite
            # with this value
            pseudo_member = cls._value2member_map_.setdefault(value, pseudo_member)
        return pseudo_member
def _create_pseudo_member_ ( cls , value ) : pseudo_member = cls . _value2member_map_ . get ( value , None ) if pseudo_member is None : # verify all bits are accounted for _ , extra_flags = _decompose ( cls , value ) if extra_flags : raise ValueError ( "%r is not a valid %s" % ( value , cls . __qualname__ ) ) # construct a singleton enum pseudo-member pseudo_member = object . __new__ ( cls ) pseudo_member . _name_ = None pseudo_member . _value_ = value # use setdefault in case another thread already created a composite # with this value pseudo_member = cls . _value2member_map_ . setdefault ( value , pseudo_member ) return pseudo_member