[Python-Dev] new imputil.py

Barry A. Warsaw bwarsaw@cnri.reston.va.us (Barry A. Warsaw)
Tue, 4 Jan 2000 16:04:48 -0500 (EST)


Happy New Year!

>>>>> "GS" == Greg Stein <gstein@lyra.org> writes:

    GS> I think Python 1.6 should drop the __import__ builtin and move
    GS> to something like sys.import_hook (to allow examination and
    GS> change).

Wait!  You can't remove builtin __import__ without breaking code.
E.g. Mailman uses __import__ quite a bit in its CGI (and other)
harnesses.  Why does __import__ need to be removed?  Why can't it just
just the same mechanism the import statement uses?

    GS> I might be able to do something where the string methods are
    GS> used if available, and use the strop module if not.  [ similar
    GS> to the 'os' bootstrapping that is done ]

    GS> Finn Bock emailed me to say that JPython does not have strop,
    GS> but does have string methods.

Sorry Greg, I haven't had time to look at this stuff at all, so maybe
I'm missing something essential, but if you just continue to use the
string module, you'll be fine for JPython and CPython 1.5.2.  In
CPython 1.5.2, you /will/ actually be using the strop module
under the covers.

In CPython 1.6 and JPython 1.1 you'll be using string methods under
the covers.  Your penalty is one layer of Python function calls.
Never use strop directly though.

>>>>> "MA" == M  <mal@lemburg.com> writes:

    MA> There has been some moaning about the current Python startup
    MA> speed, so I guess people already find the existing strategy
    MA> too slow.
 
Definitely.

-Barry