Message314598
From my understanding of the docs section on new types, https://docs.python.org/3/library/typing.html#newtype the new type based on
int() should just pass the value into the base constructor. However,
```
PercentDiscount = NewType('PercentDiscount', int)
>>> PercentDiscount(50) == int(50)
True
>>> int('50') == int(50)
True
>>> PercentDiscount('50') == PercentDiscount(50)
False
``` |
|
Date |
User |
Action |
Args |
2018-03-28 14:51:28 | avanov | set | recipients:
+ avanov |
2018-03-28 14:51:28 | avanov | set | messageid: <1522248688.28.0.467229070634.issue33170@psf.upfronthosting.co.za> |
2018-03-28 14:51:28 | avanov | link | issue33170 messages |
2018-03-28 14:51:28 | avanov | create | |
|