Can global variable be passed into Python function?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Feb 28 22:29:57 EST 2014


On Sat, 01 Mar 2014 13:03:53 +1100, Chris Angelico wrote:

> On Sat, Mar 1, 2014 at 12:59 PM, Steven D'Aprano
> <steve+comp.lang.python at pearwood.info> wrote:
>> However, the example as given won't quite work. You never instantiate
>> the Idle etc. classes, which means the methods won't work. You need to
>> make them class methods or static methods, or perform some metaclass
>> magic prevent them from being turned into instance methods when called.
> 
> Actually, he does - setting a state means instantiating that state.

Ah, so he does.


-- 
Steven



More information about the Python-list mailing list