Changes between Version 59 and Version 60 of pyson
- Timestamp:
- 02/09/22 10:37:07 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
pyson
v59 v60 63 63 The dict and list are treated even more special as we also support the List[TYPE] and Dict[KEYTYPE, VALUETYPE] types. 64 64 65 WARNING: Using Decimal causes rounding errors. This is because pyson takes python's json representation format which contains floats for numbers. And floats can not represent all decimals accurately. 65 WARNING: Using Decimal causes rounding errors. This is because pyson takes python's json representation format which contains floats for numbers. And floats can not represent all decimals accurately. For example, in python {{{str(0.24745759773026107) == '0.24745759773026108'}}}. Overall, a number string "N" in your json text will converted as {{{Decimal(str(float("N")))}}} . When in doubt, check for your number "N" that str(float(N))==N, if not you have a rounding issue. 66 66 67 67 You can use {{{ Union[X, NoneType] }}} where {{{NoneType=type(None)}}} or {{{Optional[X]}}}if the object can also be None. So for exmple you can use {{{reservationBid:Union[Bid,type(None)] = None}}}. Do not use the mypy.NoneType which is an entirely different class. We do not support {{{ Union[X,Y] }}} where both X and Y are not NoneType.