Author flox
Recipients Arfrever, effbot, eli.bendersky, eric.araujo, ezio.melotti, flox, python-dev, scoder, tshepang
Date 2012-02-12.21:07:45
SpamBayes Score 0.000188812
Marked as misclassified No
Message-id <1329080865.73.0.500579895781.issue13988@psf.upfronthosting.co.za>
In-reply-to
Content
> from xml.etree.ElementTree import _namespace_map
>
> And the import in cElementTree won't be necessary.
> After all, _namespace_map is definitely not a public API!

Because of the interaction of the support.import_fresh_module with the CleanContext context manager, it's not so easy to remove black magic.
I don't find better than:

        if hasattr(ET, '_namespace_map'):
            _namespace_map = ET._namespace_map
        else:
            from xml.etree.ElementTree import _namespace_map


This is why I kept the import in the deprecated "cElementTree" at first.
It does not hurt (it's private API), and it makes the test easier.

( If you have doubts, try ./python -m test test_xml_etree{,_c} or variants. )


I will probably commit code and documentation at once. It makes things easier regarding traceability.
History
Date User Action Args
2012-02-12 21:07:45floxsetrecipients: + flox, effbot, scoder, ezio.melotti, eric.araujo, Arfrever, eli.bendersky, tshepang, python-dev
2012-02-12 21:07:45floxsetmessageid: <1329080865.73.0.500579895781.issue13988@psf.upfronthosting.co.za>
2012-02-12 21:07:45floxlinkissue13988 messages
2012-02-12 21:07:45floxcreate