Least used builtins?
Dr. David Mertz
gnosis at gnosis.cx
Sat Jul 5 09:18:30 CEST 2003
|just means that "core Python" (i.e., the subset of Python's
|standard library used by 95% of significant code)
Nah... I think the ratio is exactly the opposite. Putting all
the things I mentioned before into outside modules would require
no modification at all to 95% of my modules (well, excluding some
unusual introspective code I've written). And the 5% that would
be affected would need one extra import line at top (unless some
mechanism like startup.py eliminated even that one line).
|The premise of PyPy is that *everything* is a likely candidate for
|reimplementation in Python. It shouldn't matter if it's a builtin.
Well... yes and no. The project is necessarily incremental.
Everything is a candidate for reimplementation, but one picks low
hanging fruit first.
|I disagree. There's nothing saying you have to describe
|everything in __builtins__ -- using that module as a teaching
|outline is surely a bad idea.
As soon as a new programmer gets an interactive shell they run
'dir()'. And then they wonder what all those names are about.
And a natural presentation puts everthing builtin together, for
example in a reference text.
|That describes most of my modules! I seldom import sys -- I probably
|import os much more often, but certainly not half of the time.
Really?! How do you get sys.argv then? Or sys.stdin? Admittedly,
a simple 'print' usually gets you the sys.stdout you want, but
what about sys.stderr?
At very least, your style of programming is very different from
mine, or from most of the modules I download. I do agree that a
bit of stuff is lumped together inside sys. Perhaps a different
factoring might have been good ten years ago... but that matters
a lot less than does what is in __builtins__.
More information about the Python-list