This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 flox
收信人 Arfrever, effbot, eli.bendersky, eric.araujo, ezio.melotti, flox, python-dev, scoder, tshepang
日期 2012-02-12.21:07:45
SpamBayes Score 0.0001888116
Marked as misclassified
Message-id <1329080865.73.0.500579895781.issue13988@psf.upfronthosting.co.za>
In-reply-to
内容
> 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.
历史
日期 用户 动作 参数
2012-02-12 21:07:45flox修改recipients: + flox, effbot, scoder, ezio.melotti, eric.araujo, Arfrever, eli.bendersky, tshepang, python-dev
2012-02-12 21:07:45flox修改messageid: <1329080865.73.0.500579895781.issue13988@psf.upfronthosting.co.za>
2012-02-12 21:07:45flox链接issue13988 messages
2012-02-12 21:07:45flox创建