Serhiy Storchaka added the comment:

I don't think there is a bug. There are several ways to get the integer 
representation of the pointer. PyLong_FromVoidPtr() is the most 
straightforward. From Python side id() uses it. printf("%p") is a way of 
getting string representation of the pointer, that string can be converted to 
integer. This way is used in object.__repr__(). Usually %p formats the pointer 
as hexadecimal, but the sign is not defined. Therefore when the pointer is 
converted to the integer it can be interpreted as either signed or unsigned 
integer. PyLong_AsVoidPtr() should accept both representations.

nosy: +mark.dickinson, serhiy.storchaka
resolution:  -> not a bug

Python tracker <>
Python-bugs-list mailing list

Reply via email to