Re: Get bound method by name

2009-03-03 Thread Chris Rebert
On Tue, Mar 3, 2009 at 12:54 PM, Steve Holden wrote: > Graham Breed wrote: >> Johannes Bauer wrote: >>> Hello group, >>> >>> I'm looking for a Python function but have forgotten it's name. >>> Essentially what I want is: >>> >>> class Foo(): >>>     def bar(self): >>>         pass >>> >>> x = Foo(

Re: Get bound method by name

2009-03-03 Thread Steve Holden
Graham Breed wrote: > Johannes Bauer wrote: >> Hello group, >> >> I'm looking for a Python function but have forgotten it's name. >> Essentially what I want is: >> >> class Foo(): >> def bar(self): >> pass >> >> x = Foo() >> y = x.MAGIC("bar") >> print(y) >> > >> >> So the question is:

Re: Get bound method by name

2009-03-03 Thread Graham Breed
Johannes Bauer wrote: Hello group, I'm looking for a Python function but have forgotten it's name. Essentially what I want is: class Foo(): def bar(self): pass x = Foo() y = x.MAGIC("bar") print(y) > So the question is: How is the magic function called which returns me

Re: Get bound method by name

2009-03-03 Thread John Machin
On Mar 3, 10:12 pm, Johannes Bauer wrote: > Hello group, > > I'm looking for a Python function but have forgotten it's name. > Essentially what I want is: > > class Foo(): >         def bar(self): >                 pass > > x = Foo() > y = x.MAGIC("bar") > print(y) > > > > So the question is: How

Re: Get bound method by name

2009-03-03 Thread Chris Rebert
On Tue, Mar 3, 2009 at 3:12 AM, Johannes Bauer wrote: > Hello group, > > I'm looking for a Python function but have forgotten it's name. > Essentially what I want is: > > class Foo(): >        def bar(self): >                pass > > x = Foo() > y = x.MAGIC("bar") getattr() is the function you se

Get bound method by name

2009-03-03 Thread Johannes Bauer
Hello group, I'm looking for a Python function but have forgotten it's name. Essentially what I want is: class Foo(): def bar(self): pass x = Foo() y = x.MAGIC("bar") print(y) > So the question is: How is the magic function called which returns me the bound method of a c