R. David Murray added the comment:

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.

----------
nosy: +r.david.murray

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27572>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to