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 r.david.murray
Recipients martin.panter, r.david.murray, rhettinger, xiang.zhang
Date 2016-07-22.14:01:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469196115.38.0.866973969346.issue27572@psf.upfronthosting.co.za>
In-reply-to
Content
Since bytes are accepted in both cases, the inconsistency does seem odd.  Looking at the history, I think the else statement that checks the types that can be handled was introduced during the initial py3k conversion, and I'm guessing that else was just forgotten in subsequent updates that added additional bytes-like types.  The non-base branch calls PyNumber_Long, where I presume it picked up the additional type support.

If a copy has to be done anyway, perhaps we can future proof the code by doing a bytes conversion internally in long_new?

Disallowing something that currently works without a good reason isn't good for backward compatibility, so I'd vote for making this work consistently one way or another.
History
Date User Action Args
2016-07-22 14:01:55r.david.murraysetrecipients: + r.david.murray, rhettinger, martin.panter, xiang.zhang
2016-07-22 14:01:55r.david.murraysetmessageid: <1469196115.38.0.866973969346.issue27572@psf.upfronthosting.co.za>
2016-07-22 14:01:55r.david.murraylinkissue27572 messages
2016-07-22 14:01:54r.david.murraycreate