Op 2005-11-04, Steven D'Aprano schreef <[EMAIL PROTECTED]>: > On Fri, 04 Nov 2005 10:48:54 +0000, Antoon Pardon wrote: > >> Please explain why this is illegal. >> >> x = 1 >> def f(): >> x += 1 > > Because names in function namespaces don't have inheritance.
Your quibling about words. This certainly works. x = 1 def f(): a = x + 1 So you could say that function namespaces do inherit from outer scopes. Whether you want to name it inheritance or not, is not the issue. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list