sgmllib too slow

Martin v. Löwis loewis at informatik.hu-berlin.de
Wed May 8 05:31:48 EDT 2002


Alex Martelli <aleax at aleax.it> writes:

> How would it help in the case in point?  Say the new sgmllib has
> identical functionality to the one distributed with Python but is
> 10 times faster.  

I believe this is not the case. It is 10 times faster, but it is not
identical in behaviour.

> Why _shouldn't_ I be able to install it instead of the distributed
> one?  How would installing it under a different name help with all
> existing places (including in the standard library) that today
> "import sgmllib"?

I don't know why you shouldn't be able to install it (*), but I do know
that you are not able to install it, except by overwriting the one in
the installation, or by inserting a directory before
sys.path[0]. Neither of these are recommended.

If you find that the replacement library works for you, distribute it
with your application, referring to it with a different name. To
simplify porting, you can write

from gathmanlibs import sgmllib

instead of

import sgmllib

Regards,
Martin

(*) In the case of sgmlop, I do know: because it is no complete
replacement. I *believe* that htmllib would break if you replaced
sgmllib, but I believe so with detailed analysis.



More information about the Python-list mailing list