[Python-Dev] The Trick
Phillip J. Eby
pje at telecommunity.com
Sat Oct 18 17:00:17 EDT 2003
At 10:11 PM 10/18/03 +0200, Alex Martelli wrote:
>Can we dream of a standard library module of "neat hacks that
>don't really warrant a built-in" in which to stash some of these
>general-purpose, no-specific-appropriate-module, useful functions
>and classes? Pluses: would save some people reimplementing
>them over and over and sometimes incorrectly; would remove
>any pressure to add not-perfectly-appropriate builtins. Minuses:
>one more library module (the, what, 211th? doesn't seem like
>a biggie). Language unchanged -- just library. Pretty please?
Hmmm.
import tricky.hacks
from dont_try_this_at_home_kids import *
I suppose 'shortcuts' would probably be a less contentious name. :)
The downside to having such a module would be that it would entertain
ongoing pressure to add more things to it. I suppose it'd be better to
have a huge shortcuts module (or maybe shortcuts package, divided by
subject matter) than to keep adding builtins.
> > (I know, by that argument several built-ins shouldn't exist. Well,
> > they might be withdrawn in 3.0; let's not add more.)
>
>"Amen and Hallelujah" to the hope of slimming language and
>built-ins in 3.0 (presumably the removed built-ins will go into a
>"legacy curiosa" module, allowing a "from legacy import *" to
>ease making old code run in 3.0? seems cheap & sensible).
I like it. Or, for symmetry, maybe 'from __past__ import lambda'. ;-)
Say, in 3.0, will there be perhaps *no* builtins? After all, you don't
need builtins to import things. Nah, that'd be too much like Java, and not
enough like pseudocode.
Ah well, time for me to stop making suggestions on what color to paint the
bicycle shed, and start doing some real work today. :)
More information about the Python-Dev
mailing list