On 30 , 22:48, "Warren Stringer" <[EMAIL PROTECTED]> wrote: > I want to call every object in a tupple, like so: > > #------------------------------------------ > def a: print 'a' > def b: print 'b' > c = (a,b) > > >>>c[:]() # i wanna > > TypeError: 'tupple' object is not callable > > >>>c[0]() # expected > a > >>>c[:][0] # huh? > a > >>> [i() for i in c] # too long and ...huh? > > a > b > [None,None] > #------------------------------------------ > > bla-bla-bla......
you can write: >>> map(lambda x: x(), c) I think that it is good idea to use "map()" function for doing somethimg with each element of a sequence, if the order of a actions not important. it is easy to read and understandable. P.S. sorry my bad English -- http://mail.python.org/mailman/listinfo/python-list