Using an interable in place of *args?
Evan Simpson
evan at 4-am.com
Fri Nov 21 11:47:32 EST 2003
More information about the Python-list mailing list
Fri Nov 21 11:47:32 EST 2003
- Previous message (by thread): Using an interable in place of *args?
- Next message (by thread): Using an interable in place of *args?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Nick Vargish wrote: > def pack(self): > # need some way to call struct.pack with a list/tuple of values > # built with [ self.__dict__[v] for v in self.fields ] > pass Shouldn't this work? struct.pack(*tuple([ self.__dict__[v] for v in self.fields ])) Cheers, Evan
- Previous message (by thread): Using an interable in place of *args?
- Next message (by thread): Using an interable in place of *args?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list