Comment on draft PEP for deprecating six builtins
Gerhard Häring
gerhard at bigfoot.de
Mon Apr 29 03:13:37 EDT 2002
* Chris Tavares <christophertavares at earthlink.net> [2002-04-29 06:47 +0000]:
>
> "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.
100 % agree with Chris. Also, Python grows new command line switches
like weed. By the current speed, it won't take long until we have -a to
-z in use. I don't like to control language behaviour by command line
switches - I want to see *in the code* how it behaves, and no, the
shebang line doesn't count, as it is a unixoid feature only.
Gerhard
--
mail: gerhard <at> bigfoot <dot> de registered Linux user #64239
web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930
public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))
More information about the Python-list
mailing list