MCPcopy Index your code
hub / github.com/python/cpython / __invert__

Method __invert__

Lib/enum.py:1647–1656  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1645 return self.__class__(value ^ other_value)
1646
1647 def __invert__(self):
1648 if self._get_value(self) is None:
1649 raise TypeError(f"'{self}' cannot be inverted")
1650
1651 if self._inverted_ is None:
1652 if self._boundary_ in (EJECT, KEEP):
1653 self._inverted_ = self.__class__(~self._value_)
1654 else:
1655 self._inverted_ = self.__class__(self._singles_mask_ & ~self._value_)
1656 return self._inverted_
1657
1658 __rand__ = __and__
1659 __ror__ = __or__

Callers

nothing calls this directly

Calls 2

_get_valueMethod · 0.95
__class__Method · 0.45

Tested by

no test coverage detected