Mark Dickinson <dicki...@gmail.com> added the comment:

A couple of suggestions regarding the patch:

(1) I'd suggest leaving the first part of handle_range_longs intact, up to and 
including the "/* ilow and ihigh correct now; do istep */" block.  Then build 
out the three "if (!PyInt_Check(...)) ..." blocks below to include argument 
conversion.  I think the patch would look cleaner this way.

(2) Rather than using PyNumber_Long, I'd prefer an explicit check for, and call 
to, nb_int.  This is the behaviour that's used for the 'l' getargs format.  
PyNumber_Long is considerably more complicated, and involves looking at 
__trunc__ and __long__;  so if you use PyNumber_Long you'll still end up with 
inconsistent behaviour between small and large arguments.

----------

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

Reply via email to