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/050037.html below:

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

[Python-Dev] Re: print "%X" % id(object()) not so nice [Python-Dev] Re: print "%X" % id(object()) not so niceScott David Daniels Scott.Daniels at Acm.Org
Sat Nov 20 01:52:55 CET 2004
Terry Reedy wrote:
>>>>def id(o, max = 2**32):
> 
> ...   i = __builtins__.id(o)
> ...   return (i < 0) and (max - i) or i
> ...
> 
This code doesn't need an extra parameter:
     def id(o):
         return (sys.maxint * 2 + 1) & __builtins__.id(o)

-- 
-- Scott David Daniels
Scott.Daniels at Acm.Org

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