A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-November/050047.html below:

[Python-Dev] Re: Re: Re: print "%X" % id(object()) not so nice

[Python-Dev] Re: Re: Re: print "%X" % id(object()) not so niceMichael Hudson mwh at python.net
Sat Nov 20 16:41:24 CET 2004
"Terry Reedy" <tjreedy at udel.edu> writes:

> I, on the other hand, having never used either, find the difference in 
> printed ids in
>
>>>> def f(): pass
> ...
>>>> f, id(f)
> (<function f at 0x00868158>, 8814936)
>
> at least mildly disturbing.  Do you only need to do such matching for 
> complex objects that get the <type name at 0x########> representation?

This hardly seems worth discussing :)

It's a pointer.  Pointers are printed in hex.  It's Just The Way It
Is.  I don't know why.  

Actually, the "0x00868158" above is produced by C's %p format
operator.  So, in fact, ANSI C is probably why it is The Way It Is.

Cheers,
mwh

-- 
  Remember - if all you have is an axe, every problem looks 
  like hours of fun.                                        -- Frossie
               -- http://home.xnet.com/~raven/Sysadmin/ASR.Quotes.html
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4