Re: invoke method on many instances

2009-07-27 Thread Aahz
In article , Gabriel Genellina wrote: > >Ok, if you insist... > >NLMPI = Ni La Más Puta Idea. >IHNFI = I Have No Fucking Idea. Thanks! -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "Many customs in this life persist because they ease friction and promote produ

Re: invoke method on many instances

2009-07-26 Thread Gabriel Genellina
En Sun, 26 Jul 2009 12:44:02 -0300, Aahz escribió: In article , Gabriel Genellina wrote: En Thu, 23 Jul 2009 21:27:35 -0300, Aahz escribió: In article , Gabriel Genellina wrote: NLMPI What? IHNFI What? Abbreviations are fine, but if someone asks you about one, it would be nice to

Re: invoke method on many instances

2009-07-26 Thread Aahz
In article , Gabriel Genellina wrote: >En Thu, 23 Jul 2009 21:27:35 -0300, Aahz escribió: >> In article , >> Gabriel Genellina wrote: >>> >>> NLMPI >> >> What? > >IHNFI What? Abbreviations are fine, but if someone asks you about one, it would be nice to just expand it instead of replying with

Re: invoke method on many instances

2009-07-24 Thread Gabriel Genellina
En Thu, 23 Jul 2009 21:27:35 -0300, Aahz escribió: In article , Gabriel Genellina wrote: NLMPI What? IHNFI -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: invoke method on many instances

2009-07-23 Thread Aahz
In article , Gabriel Genellina wrote: > >NLMPI What? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "At Resolver we've found it useful to short-circuit any doubt and just refer to comments in code as 'lies'. :-)" --Michael Foord paraphrases Christian Mu

Re: invoke method on many instances

2009-07-22 Thread Gabriel Genellina
En Wed, 22 Jul 2009 10:14:12 -0300, Alan G Isaac escribió: On Fri, 17 Jul 2009 05:19:50 +, Alan G Isaac wrote: def apply2(itr, methodname, *args, **kwargs): f = operator.methodcaller(methodname, *args, **kwargs) for item in itr: f(item) On 7/17/2009 3:45 AM Steven D'A

Re: invoke method on many instances

2009-07-22 Thread Alan G Isaac
>>> On Fri, 17 Jul 2009 05:19:50 +, Alan G Isaac wrote: def apply2(itr, methodname, *args, **kwargs): f = operator.methodcaller(methodname, *args, **kwargs) for item in itr: f(item) >> On 7/17/2009 3:45 AM Steven D'Aprano apparently wrote: >>> for obj in ob

Re: invoke method on many instances

2009-07-21 Thread Simon Forman
On Jul 20, 3:29 am, "Gabriel Genellina" wrote: > En Sat, 18 Jul 2009 12:31:46 -0300, Alan G Isaac   > escribió: > > >> On Fri, 17 Jul 2009 05:19:50 +, Alan G Isaac wrote: > >>> def apply2(itr, methodname, *args, **kwargs): > >>>     f = operator.methodcaller(methodname, *args, **kwargs) > >>>

Re: invoke method on many instances

2009-07-20 Thread Gabriel Genellina
En Sat, 18 Jul 2009 12:31:46 -0300, Alan G Isaac escribió: On Fri, 17 Jul 2009 05:19:50 +, Alan G Isaac wrote: def apply2(itr, methodname, *args, **kwargs): f = operator.methodcaller(methodname, *args, **kwargs) for item in itr: f(item) On 7/17/2009 3:45 AM Steven D'Ap

Re: invoke method on many instances

2009-07-19 Thread Piet van Oostrum
> Rainer Grimm (RG) a écrit: >RG> Hallo Alan, >>> def apply2(itr, methodname, *args, **kwargs): >>>     f = operator.methodcaller(methodname, *args, **kwargs) >>>     for item in itr: >>>         f(item) >RG> you can do it in a functional way. > class A(object): >RG> ... def hello(self

Re: invoke method on many instances

2009-07-19 Thread Rainer Grimm
Hallo Alan, > def apply2(itr, methodname, *args, **kwargs): >     f = operator.methodcaller(methodname, *args, **kwargs) >     for item in itr: >         f(item) you can do it in a functional way. >>> class A(object): ... def hello(self): return "hello: " + str ( self.__class__.__name__ ) ... >>

Re: invoke method on many instances

2009-07-18 Thread Terry Reedy
Alan G Isaac wrote: On Fri, 17 Jul 2009 05:19:50 +, Alan G Isaac wrote: def apply2(itr, methodname, *args, **kwargs): f = operator.methodcaller(methodname, *args, **kwargs) for item in itr: f(item) On 7/17/2009 3:45 AM Steven D'Aprano apparently wrote: for obj in objects:

Re: invoke method on many instances

2009-07-18 Thread Alan G Isaac
> On Fri, 17 Jul 2009 05:19:50 +, Alan G Isaac wrote: >> def apply2(itr, methodname, *args, **kwargs): >> f = operator.methodcaller(methodname, *args, **kwargs) >> for item in itr: >> f(item) On 7/17/2009 3:45 AM Steven D'Aprano apparently wrote: > for obj in objects: > ge

Re: invoke method on many instances

2009-07-17 Thread Steven D'Aprano
On Fri, 17 Jul 2009 05:19:50 +, Alan G Isaac wrote: > As a recurrent situation, I need to invoke the same method on many > instances. Speed matters, but the solution should be pure Python. Is > the following convenience function a reasonable approach? > > def apply2(itr, methodname, *args, *

invoke method on many instances

2009-07-16 Thread Alan G Isaac
As a recurrent situation, I need to invoke the same method on many instances. Speed matters, but the solution should be pure Python. Is the following convenience function a reasonable approach? def apply2(itr, methodname, *args, **kwargs): f = operator.methodcaller(methodname, *args, **kwarg