[Python-Dev] builtin_id() returns negative numbers

Richard Brodie leogah at spamcop.net
Mon Feb 14 23:35:31 CET 2005


> Maybe it's just a wart we have to live with now; OTOH,
> the docs explicitly warn that id() may return a long, so any code
> relying on "short int"-ness has always been relying on an
> implementation quirk.

Well, the docs say that %x does unsigned conversion, so they've
been relying on an implementation quirk as well ;)

Would it be practical to add new conversion syntax to string 
interpolation? Like, for example, %p as an unsigned hex number
the same size as (void *). 

Otherwise, unless I misunderstand integer unification, one would
just have to strike the distinction between, say, %d and %u.




More information about the Python-Dev mailing list