On Tuesday 05 July 2016 14:41, Ian Kelly wrote: > Class definitions don't create closures like functions do. When Python > executes a class definition, the metaclass creates a dict, and then > the interpreter execs the class body using that dict as the locals. > The body of class A has one locals dict, and the body of class B has a > completely separate locals dict. The only way to share variables > between them (prior to the class objects actually being constructed) > is via globals.
So, like nested functions in Python before "from __future__ import nested_scopes". Okay, that's reasonable. -- Steve -- https://mail.python.org/mailman/listinfo/python-list