STINNER Victor <victor.stin...@haypocalc.com> added the comment:

> I'm still not sure why anyone would care about getting longs
> instead of ints back from int(x)

It's strange that sometimes we need to write int(int(obj)) to get an
integer :-/ I usually use int(x) to convert x to an integer (type 'int'
and not 'long').

> (0) Please could you add some tests!

done

> (1) Shouldn't the first line you added include a check 
> for res == NULL?  

segfault... ooops :-) fixed

> (2) It looks as though the patched code ends up calling 
> PyLong_Check twice (...)

done

See updated patch.

----------
Added file: http://bugs.python.org/file13455/force_int-2.patch

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

Reply via email to