[Patches] getpath patch (repost)
Greg Ward
gward@mems-exchange.org
Tue, 23 May 2000 17:38:04 -0400
On 23 May 2000, M.-A. Lemburg said:
> URL: http://w1.132.telia.com/~u13208596/exceptions.htm
>
> This is not a frozen module -- it's a reimplementation of
> exceptions.py in C (and one which is pretty easy to maintain,
> IMHO).
>
> Python could use this small builtin module as fall-back
> solution in case exceptions.py is not found (instead of
> causing a fatal error).
Seems to me that this is really how the standard exceptions should be
defined. IOError, OSError, TypeError, etc. really are part of the
language, and Python's implementation language is C. The whole idea of
having such a fundamental part of the language as the standard
exceptions imported at run-time strikes me as slow, prone to
inexplicable failure, and all-round dodgy at best.
(My opposition to "implementing Python in Python" stems from many years'
experience with Perl. Some of Perl's most fundamental features --
importing symbols from modules, loading extensions, crashing with a
stack traceback, autoloading functions from a split-up module, etc. --
are implemented in Perl. This slows things down a lot -- any time you
load a non-trivial Perl module, you suddenly find yourself loading half
a dozen ancillary modules just to get started. While Perl wins big on
the "perl -e 1" vs "python -c 1" overhead test, I bet Python would come
out ahead on a "perl -MCGI -e 1" vs "python -c 'import cgilib'" test.)
Greg
--
Greg Ward - software developer gward@mems-exchange.org
MEMS Exchange / CNRI voice: +1-703-262-5376
Reston, Virginia, USA fax: +1-703-262-5367