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

Reinhold Birkenfeld reinhold-birkenfeld-nospam at wolke7.net
Wed Aug 17 18:37:11 CEST 2005


Christian Robottom Reis wrote:
> In Launchpad (mainly because SQLObject is used) we end up with quite a
> few locals named id. Apart from the fact that naturally clobbering
> builtins is a bad idea, we get quite a few warnings when linting
> throughout the codebase. I've fixed these as I've found them, but today
> Andrew pointed out to me that this is noted in:
> 
>     http://www.python.org/doc/essays/ppt/regrets/PythonRegrets.ppt
> 
> 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've done some searching through my code and id() isn't the most-used
> builtin, so from my perspective the impact would be limited, but of
> course others might think otherwise.
> 
> Is it worth writing a PEP for this, or is it crack?

As I can see, this is not going to happen before Py3k, as it is completely
breaking backwards compatibility. As such, a PEP would be unnecessary.

Reinhold

-- 
Mail address is perfectly valid!



More information about the Python-Dev mailing list