I'm trying to follow the example listed in the wiki at
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject regarding the
use of a metaclass.
What I don't understand is how the metaclass (EntitySingleton) has access to
the variable ctx which is instantinated outside the scope of the
Orest Kozyar wrote:
I'm trying to follow the example listed in the wiki at
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject regarding the
use of a metaclass.
What I don't understand is how the metaclass (EntitySingleton) has access to
the variable ctx which is instantinated
On Thu, Aug 30, 2007 at 06:02:12PM -0400, Orest Kozyar wrote:
I'm trying to follow the example listed in the wiki at
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject regarding the
use of a metaclass.
What I don't understand is how the metaclass (EntitySingleton) has access to
Dave Kuhlman wrote:
So far so good. But, here is the one I do not understand.
G1 = 111
class A(object):
G1 = 222
def show(self):
print G1
def test():
a = A()
a.show()
test()
But, when I run this I see 111, not 222.
Dave Kuhlman [EMAIL PROTECTED] wrote
Actually, the particular edition of Alan's book that I have is old
enough so that it does not discuss the Enclosing namespace, which
came later to Python. The enclosing namespace not make a
difference in your example, but does in mine.
The paper book is