-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
Current DecimalTuple definition is:
class DecimalTuple(NamedTuple):
sign: int
digits: tuple[int, ...]
exponent: intBut if a decimal value is NaN the exponent is of type str. The following example illustrate that:
>>> from decimal import Decimal
>>> exponent = Decimal('NaN').as_tuple().exponent
>>> print(exponent)
n
>>> print(type(exponent))
<class 'str'>
>>>It seems like the correct definition should be like this:
class DecimalTuple(NamedTuple):
sign: int
digits: tuple[int, ...]
exponent: Union[int, str]Metadata
Metadata
Assignees
Labels
No labels