Re: invoke method on many instances

2009-07-27 Thread Aahz
In article mailman.3747.1248642434.8015.python-l...@python.org, Gabriel Genellina gagsl-...@yahoo.com.ar 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

Re: invoke method on many instances

2009-07-26 Thread Aahz
In article mailman.3648.1248429993.8015.python-l...@python.org, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Thu, 23 Jul 2009 21:27:35 -0300, Aahz a...@pythoncraft.com escribió: In article mailman.3561.1248307942.8015.python-l...@python.org, Gabriel Genellina gagsl-...@yahoo.com.ar wrote:

Re: invoke method on many instances

2009-07-26 Thread Gabriel Genellina
En Sun, 26 Jul 2009 12:44:02 -0300, Aahz a...@pythoncraft.com escribió: In article mailman.3648.1248429993.8015.python-l...@python.org, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Thu, 23 Jul 2009 21:27:35 -0300, Aahz a...@pythoncraft.com escribió: In article

Re: invoke method on many instances

2009-07-24 Thread Gabriel Genellina
En Thu, 23 Jul 2009 21:27:35 -0300, Aahz a...@pythoncraft.com escribió: In article mailman.3561.1248307942.8015.python-l...@python.org, Gabriel Genellina gagsl-...@yahoo.com.ar 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 mailman.3561.1248307942.8015.python-l...@python.org, Gabriel Genellina gagsl-...@yahoo.com.ar 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

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 objects:

Re: invoke method on many instances

2009-07-22 Thread Gabriel Genellina
En Wed, 22 Jul 2009 10:14:12 -0300, Alan G Isaac alan.is...@gmail.com 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

Re: invoke method on many instances

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

Re: invoke method on many instances

2009-07-20 Thread Gabriel Genellina
En Sat, 18 Jul 2009 12:31:46 -0300, Alan G Isaac alan.is...@gmail.com 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

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__ ) ... class

Re: invoke method on many instances

2009-07-19 Thread Piet van Oostrum
Rainer Grimm r.gr...@science-computing.de (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

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: getattr(obj,

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

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,