Re: unexpected behaviour playing with dynamic methods

2012-02-23 Thread Marc Aymerich
On Feb 23, 2:05 pm, Peter Otten <__pete...@web.de> wrote: > Marc Aymerich wrote: > > Hi, > > > I'm playing a bit with python dynamic methods and I came up with a > > scenario that I don't understant. Considering the follow code: > > > # Declare a dummy class > > class A(object): > >     pass > > >

Re: unexpected behaviour playing with dynamic methods

2012-02-23 Thread Peter Otten
Marc Aymerich wrote: > Hi, > > I'm playing a bit with python dynamic methods and I came up with a > scenario that I don't understant. Considering the follow code: > > # Declare a dummy class > class A(object): > pass > > # generate a dynamic method and insert it to A class > for name in ['a

unexpected behaviour playing with dynamic methods

2012-02-23 Thread Marc Aymerich
Hi, I'm playing a bit with python dynamic methods and I came up with a scenario that I don't understant. Considering the follow code: # Declare a dummy class class A(object): pass # generate a dynamic method and insert it to A class for name in ['a', 'b', 'c']: if name == 'b': @p