MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / EnumTyped

Class EnumTyped

projects/Python/proto/test.py:128–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126
127
128class EnumTyped(enum.IntEnum, metaclass=fbe.DefaultEnumMeta):
129 ENUM_VALUE_0 = int(0) + 0
130 ENUM_VALUE_1 = ord('1') + 0
131 ENUM_VALUE_2 = ord('1') + 1
132 ENUM_VALUE_3 = ord('3') + 0
133 ENUM_VALUE_4 = ord('3') + 1
134 ENUM_VALUE_5 = ENUM_VALUE_3
135 unknown = ~0
136
137 __slots__ = ()
138
139 def __format__(self, format_spec):
140 return self.__str__()
141
142 def __str__(self):
143 if self.value == EnumTyped.ENUM_VALUE_0:
144 return "ENUM_VALUE_0"
145 if self.value == EnumTyped.ENUM_VALUE_1:
146 return "ENUM_VALUE_1"
147 if self.value == EnumTyped.ENUM_VALUE_2:
148 return "ENUM_VALUE_2"
149 if self.value == EnumTyped.ENUM_VALUE_3:
150 return "ENUM_VALUE_3"
151 if self.value == EnumTyped.ENUM_VALUE_4:
152 return "ENUM_VALUE_4"
153 if self.value == EnumTyped.ENUM_VALUE_5:
154 return "ENUM_VALUE_5"
155 return "<unknown>"
156
157 @classmethod
158 def _missing_(cls, value):
159 return EnumTyped.unknown
160
161 @staticmethod
162 def __from_json__(value):
163 if value is None:
164 return None
165 return EnumTyped(value)
166
167
168# Fast Binary Encoding EnumTyped field model

Callers 3

__from_json__Method · 0.70
getMethod · 0.70
getMethod · 0.70

Calls

no outgoing calls

Tested by 3

__from_json__Method · 0.56
getMethod · 0.56
getMethod · 0.56