[Python-checkins] [Python-Dev] peps: Add Alexandre's suggestions

Antoine Pitrou solipsis at pitrou.net
Tue Aug 16 13:23:44 CEST 2011


On Tue, 16 Aug 2011 20:15:51 +1000
Nick Coghlan <ncoghlan at gmail.com> wrote:
> >
> > Oops, I admit I hadn't read PEP 395.
> > PEP 395 focuses on module aliasing, while the suggestion above focuses
> > on the path of objects in modules. How can we reconcile the two? Do we
> > want __qualname__ to be a relative "path" inside the module?
> > (but then __qualname__ cannot specify its own module name).
> 
> I was more thinking that if pickle grew the ability to handle two
> different names for objects, then PEP 395 could run off the same
> feature without having to mess with sys.modules.

But what happens if a module contains, say, a nested class with a
__qualname__ (assigned by the interpreter) of "module_name.A.B", and the
module later gets a __qualname__ (assigned by the user) of
"module_alias"?

Regards

Antoine.


More information about the Python-checkins mailing list