Re: Python Macros

From: Michele Simionato (michele.simionato_at_gmail.com)
Date: 10/05/04


Date: 4 Oct 2004 23:41:10 -0700

Arich Chanachai <macrocosm@fastmail.fm> wrote in message
> Paul Foley wrote:
> >
> >What on Earth can you mean by this? Python already has it, and always
> >has. What do you think "foo.bar()" is other than "pass message `bar'
> >to object `foo'"?
> >
> What if foo doesn't know about bar(), can I tell foo that perhaps it
> should send the bar() message to...say....boo?

You want to redefine __getattr__ and __setattr__. It is pretty easy to
search the documentation for them.

            Michele Simionato



Relevant Pages