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

On Tue, Aug 16, 2011 at 11:30 AM, antoine.pitrou <python-checkins@python.org> wrote:
I think this is the part that ties in with the pickle-related aspects for PEP 395 - using '__qualname__' would be one way to align a module's real name with where it should be retrieved from and where it's documentation lives (I like 'qualified name' as a term, too). Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

On Tue, 16 Aug 2011 12:35:48 +1000 Nick Coghlan <ncoghlan@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). Regards Antoine.

On Tue, Aug 16, 2011 at 7:25 PM, Antoine Pitrou <solipsis@pitrou.net> wrote:
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. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

On Tue, 16 Aug 2011 20:15:51 +1000 Nick Coghlan <ncoghlan@gmail.com> wrote:
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.

On Tue, Aug 16, 2011 at 9:23 PM, Antoine Pitrou <solipsis@pitrou.net> wrote:
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@gmail.com | Brisbane, Australia

On Tue, 16 Aug 2011 12:35:48 +1000 Nick Coghlan <ncoghlan@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). Regards Antoine.

On Tue, Aug 16, 2011 at 7:25 PM, Antoine Pitrou <solipsis@pitrou.net> wrote:
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. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

On Tue, 16 Aug 2011 20:15:51 +1000 Nick Coghlan <ncoghlan@gmail.com> wrote:
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.

On Tue, Aug 16, 2011 at 9:23 PM, Antoine Pitrou <solipsis@pitrou.net> wrote:
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@gmail.com | Brisbane, Australia
participants (2)
-
Antoine Pitrou
-
Nick Coghlan