[issue33170] New type based on int() created with typing.NewType is not consistent

2018-03-28 Thread Maxim Avanov
Maxim Avanov added the comment: Ok, after further reading, I see that NewType creates an identity stub. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue33170] New type based on int() created with typing.NewType is not consistent

2018-03-28 Thread Maxim Avanov
Maxim Avanov added the comment: Logically, I would expect it to behave similarly to ``` >>> class PercentDiscount(int): pass >>> PercentDiscount('50') == PercentDiscount(50) True ``` -- ___ Python tracker

[issue33170] New type based on int() created with typing.NewType is not consistent

2018-03-28 Thread Maxim Avanov
New submission from Maxim Avanov : >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 =