On Fri, Nov 4, 2011 at 12:38 PM, Antoine Pitrou
On Sun, 30 Oct 2011 09:52:15 +1000 Nick Coghlan
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.
Hm. Both 'f.g' and 'f().g' for f().__qname__ are misleading, since both
look like valid expressions but neither will actually retrieve the intended
object. I'd be tempted to return something like '<local in f>.g' where 'f'
would be f.__qname__. And yes, if f.__qname__ were '<local in xyzzy>.f',
then f().__qname__ should be '