Python Macros

has has.temp2 at
Tue Oct 5 10:13:48 CEST 2004

Arich Chanachai <macrocosm at> wrote in message news:<mailman.4261.1096912338.5135.python-list at>...

> Not sure I understand you here.  I want to implement messages like in 
> ObjC where if you send a msg to an object and that object does know what 
> to do with it, it can send the obj automatically to another object which 
> might know what to do with it.

You can implement this behaviour using Python's magic __getattr__
method and getattr function to request an attribute from another
object. See:

For real macros, you'll have to go to Lisp or Lisp derivatives such as
Dylan. The rest of the programming world is still catching up to 1958.

More information about the Python-list mailing list