[Python-Dev] PyTypeObject type names in Modules/

Eli Bendersky eliben at gmail.com
Thu Jan 3 15:40:46 CET 2013


>>
> >> 2013/1/1 Eli Bendersky <eliben at gmail.com>:
> >> > Hello and happy 2013,
> >> >
> >> > Something I noticed earlier today is that some C versions of stdlib
> >> > modules
> >> > define their name similarly to the Python version in their
> PyTypeObject.
> >> > Some examples: Decimal, xml.etree's Element. Others prepend an
> >> > understore,
> >> > like _pickle.Pickler and many others.
> >> >
> >>
> >> I don't it's terribly important except if the object from the C module
> >> is directly exposed through the API it's nicer if it's __name__
> >> doesn't have a leading underscore.
> >
>

As a followup question: would it be considered a compatibility-breaking
change to rename PyTypeObject names? As a concrete example, in
Modules/_elementtree.c the name of Element_Type (essentially the
xml.etree.ElementTree.Element replacement in C) is "Element". For the
purpose of pickling/unpickling it should be named "_elementtree.Element" or
"xml.etree.ElementTree.Element" or some such thing. Can such a change be
made between 3.3 and 3.4? Between 3.3 and 3.3.1?

Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130103/eff0c351/attachment.html>


More information about the Python-Dev mailing list