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

Nick Coghlan ncoghlan at gmail.com
Tue Aug 16 13:37:31 CEST 2011


On Tue, Aug 16, 2011 at 9:23 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> 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"?

Yeah, I don't think it works with PEP 395 in its current state. But
then, I'm not sure 395 will work at all in its current state -
definitely a work in progress, that one. However, I'll definitely keep
this aspect in mind next time I update it - even if they don't use the
same mechanism, they should at least be compatible proposals.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list