This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients serhiy.storchaka
Date 2018-04-17.16:54:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1523984052.37.0.682650639539.issue33299@psf.upfronthosting.co.za>
In-reply-to
Content
_PyCode_ConstantKey() wraps a constant into a tuple that contains other items besides the wrapped object. This makes booleans different from 0 and 1, makes numbers of different type different (1, 1.0 and 1.0+0j), makes floating point zeros with different signs different (0.0 and -0.0), and avoids a ByteWarning from comparing strings and bytes.

But for some types objects are always different from objects of other types and from tuples. _PyCode_ConstantKey() can be made faster and using less memory if return the object of these types unwrapped.
History
Date User Action Args
2018-04-17 16:54:12serhiy.storchakasetrecipients: + serhiy.storchaka
2018-04-17 16:54:12serhiy.storchakasetmessageid: <1523984052.37.0.682650639539.issue33299@psf.upfronthosting.co.za>
2018-04-17 16:54:12serhiy.storchakalinkissue33299 messages
2018-04-17 16:54:12serhiy.storchakacreate