Re: [Python-ideas] Allowing def to assign to anything

Oct. 26, 2015
8:57 a.m.
how about class Dispatch(object): @staticmethod def foo(bar): return bar * bar def __getitem__(self, key): return self.__getattribute__(key) dispatch = Dispatch()
test.dispatch['foo'](2) 4
this leaves the module namespace less polluted. -Alexander On 26 October 2015 at 18:27, Ian Kelly <ian.g.kelly@gmail.com> wrote:
3432
Age (days ago)
3432
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexander Heger