Re: Nested scopes and class variables
wittempj_at_hotmail.com
Date: 01/31/05
- Next message: Nick Coghlan: "Re: Nested scopes and class variables"
- Previous message: Marco Aschwanden: "COM on a network drive can't find pywintypes23.dll"
- In reply to: Dave Benjamin: "Nested scopes and class variables"
- Next in thread: Nick Coghlan: "Re: Nested scopes and class variables"
- Reply: Nick Coghlan: "Re: Nested scopes and class variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 Jan 2005 00:58:42 -0800
To me it seems you should do it something like this:
-def f(x):
- class C(object):
- def __init__(self, x):
- self.x = x # here you set the attribute for class C
- c = C(x) # instantiate a C object
- print c.x
-f(5)
- Next message: Nick Coghlan: "Re: Nested scopes and class variables"
- Previous message: Marco Aschwanden: "COM on a network drive can't find pywintypes23.dll"
- In reply to: Dave Benjamin: "Nested scopes and class variables"
- Next in thread: Nick Coghlan: "Re: Nested scopes and class variables"
- Reply: Nick Coghlan: "Re: Nested scopes and class variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]