[XML-SIG] Uniform interface with Python 2.0

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Tue, 19 Sep 2000 20:52:26 +0200


> OK.  It's all in the patch manager now, as:
> 
>   101570         *NS methods on handler.py
>   101571         adds make_parser to xml.sax
>   101572         updates XMLGenerator to new interfaces
>   101573         a first start on updating expatreader.py

I see 101570 and 101572 is approved, so I look forward to see them in
the tree. On 101573, the *NS part looks fine; I assume the missing
part is about updating the attributes.

For 101573, I have two concerns. First, I feel that the configuration
machinery is overkill: Python 2.0 will ship with a single driver, so
there are not much parsers to chose from. If we don't provide these
many options now, we can still add it later if users actually need
them.

Secondly, it seems that loading drivers with imp.load_module puts them
with their unqualified name into sys.modules. Why can't create_parser
simply be

    def python_create_parser(parser_name):
        drv_module = __import__(parser_name,globals(),locals(),['create_parser'])
        return drv_module.create_parser()

Regards,
Martin