Inserting class namespace into method scope
gd.usenet at spamfence.net
Sat Nov 20 17:45:32 CET 2010
Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> wrote:
>I find myself having need of a class where the class scope is included in
>the scope of methods in the class. A simple example from Python 3.1:
>x = "outside"
> x = "inside"
> def method(self):
> return x
>I would like Magic().method() to return "inside" rather than "outside".
Try this instead:
More information about the Python-list