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

Method __add__

Lib/test/test_enum.py:2113–2121  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

2111 # for simplicity, we only define one operator that
2112 # propagates expressions
2113 def __add__(self, other):
2114 temp = int(self) + int( other)
2115 if isinstance(self, NamedInt) and isinstance(other, NamedInt):
2116 return NamedInt(
2117 '({0} + {1})'.format(self.__name__, other.__name__),
2118 temp,
2119 )
2120 else:
2121 return temp
2122
2123 class NEI(NamedInt, Enum):
2124 __qualname__ = 'NEI' # needed for pickle protocol 4

Callers

nothing calls this directly

Calls 2

NamedIntClass · 0.85
formatMethod · 0.45

Tested by

no test coverage detected