[Python-Dev] Deprecating builtin id (and moving it to sys())

Anthony Baxter anthony at interlink.com.au
Thu Aug 18 06:09:16 CEST 2005

On Thursday 18 August 2005 00:02, Christian Robottom Reis wrote:
> I wonder: is moving id() to sys doable in the 2.5 cycle, with a
> deprecation warning being raised for people using the builtin? We'd then
> phase it out in one of the latter 2.x versions.

I'm neutral on putting id() also into sys. I'm -1 on either issuing a
deprecation warning or, worse yet, removing the id() builtin. The warnings
system is expensive to call, and I know from a brief look at a bunch of code
that I use id() inside some tight inner loops. 

Removing it entirely is gratuitous breakage, for a not very high payoff. If
you _really_ want to call a local variable 'id' you can (but shouldn't). 
You also can't/shouldn't call a variable 'class', 'def', or 'len' -- but I
don't see any movement to allow these...


Anthony Baxter     <anthony at interlink.com.au>
It's never too late to have a happy childhood.

More information about the Python-Dev mailing list