Thanks for the feedback, people.
I actually only need the "bar" part (instance methods). I added the "foo"
part to generalize the question without really thinking it through first.
Still, it has gotten me more information than I ever imagined. So thanks
again.
g
--
http://mail.python.org/m
On Sat, 19 Nov 2005 14:12:25 GMT, "guy lateur" <[EMAIL PROTECTED]> wrote:
>Hi all,
>
>Suppose you have this class:
>
>class foo:
>def bar():
>
>Suppose you also have the strings "foo" and "bar". How can you obtain the
>function foo.bar()?
>
>Surely somebody knows..
>
Sorry, clean forgot about
guy lateur wrote:
> Hi all,
>
> Suppose you have this class:
>
> class foo:
> def bar():
>
> Suppose you also have the strings "foo" and "bar". How can you obtain the
> function foo.bar()?
>
> Surely somebody knows..
>
> TIA,
> g
>
>
Would that do?
>>> class foo:
@staticmeth
On Sat, 19 Nov 2005 14:12:25 GMT, "guy lateur" <[EMAIL PROTECTED]> wrote:
>Hi all,
>
>Suppose you have this class:
>
>class foo:
>def bar():
>
>Suppose you also have the strings "foo" and "bar". How can you obtain the
>function foo.bar()?
Why don't you type these things into an interactive py
guy lateur wrote:
> Hi all,
>
> Suppose you have this class:
>
> class foo:
> def bar():
>
> Suppose you also have the strings "foo" and "bar". How can you obtain the
> function foo.bar()?
>
> Surely somebody knows..
getattr helps. However, your example won't work: it misses either a
sta
f = getattr(obj,"bar")
f()
guy lateur wrote:
> Hi all,
>
> Suppose you have this class:
>
> class foo:
> def bar():
>
> Suppose you also have the strings "foo" and "bar". How can you obtain the
> function foo.bar()?
>
> Surely somebody knows..
>
> TIA,
> g
--
http://mail.python.org/mailman
Hi all,
Suppose you have this class:
class foo:
def bar():
Suppose you also have the strings "foo" and "bar". How can you obtain the
function foo.bar()?
Surely somebody knows..
TIA,
g
--
http://mail.python.org/mailman/listinfo/python-list