[Python-ideas] PEP 3155 - Qualified name for classes and functions

Antoine Pitrou solipsis at pitrou.net
Fri Nov 4 20:38:42 CET 2011


On Sun, 30 Oct 2011 09:52:15 +1000
Nick Coghlan <ncoghlan at gmail.com> wrote:
> > Example with nested functions
> > -----------------------------
> >
> >>>> def f():
> > ...   def g(): pass
> > ...   return g
> > ...
> >>>> f.__qname__
> > 'f'
> >>>> f().__qname__
> > 'f.g'
> 
> For nested functions, I suggest adding something to the qname to
> directly indicate that the scope is hidden. Adding parentheses to the
> name of the outer function would probably work:
> 
>     f().g

I don't know, I find the "()" a bit too smart. I'd like Guido's
advice on the matter.

Regards

Antoine.





More information about the Python-ideas mailing list