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

Class OrderSide

projects/Python/proto/proto.py:19–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18
19class OrderSide(enum.IntEnum, metaclass=fbe.DefaultEnumMeta):
20 buy = int(0) + 0
21 sell = int(0) + 1
22 unknown = ~0
23
24 __slots__ = ()
25
26 def __format__(self, format_spec):
27 return self.__str__()
28
29 def __str__(self):
30 if self.value == OrderSide.buy:
31 return "buy"
32 if self.value == OrderSide.sell:
33 return "sell"
34 return "<unknown>"
35
36 @classmethod
37 def _missing_(cls, value):
38 return OrderSide.unknown
39
40 @staticmethod
41 def __from_json__(value):
42 if value is None:
43 return None
44 return OrderSide(value)
45
46
47# Fast Binary Encoding OrderSide field model

Callers 5

__from_json__Method · 0.70
getMethod · 0.70
getMethod · 0.70
__init__Method · 0.70
get_fieldsMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected