Comment on draft PEP for deprecating six builtins

Chris Tavares christophertavares at earthlink.net
Mon Apr 29 02:47:37 EDT 2002


"Raymond Hettinger" <python at rcn.com> wrote in message
news:aaim48$7fd$1 at bob.news.rcn.net...
[ ... snip ... ]
>
>     I propose that a simple means be provided to re-enable those functions
> at
>     will when they are needed to run old code.  Add a command line
option -b
>     and an equivalent environment variable, PYTHONBUILTINRESTORE which
would
>     start-up Python by running:
>
>         from functionals import map, filter, reduce
>         from math import pow, divmod
>         from deprecated import input
>

No, no, no, no, no, no, no, no, no. This would place the burden of calling
this code correctly on the end user. How's the average programmer going to
know when to use -b? What if somebody set PYTHONBUILTINRESTORE once, then
trashes his .bashrc file, and now none of his previously working Python code
works? These kinds of command line switches are evil.

Also, what about environments without command lines? Python runs on a lot
more than just Unix.

The "directive" needs to be in the code. And you've already provided the
form of this directive: the import statements above.

I would think the reasonable migration would be to add the modules listed
above (or add the functions as mentioned), but leave the builtins for a
version or two. Then remove the builtins.

-Chris






More information about the Python-list mailing list