doesNotUnderstand ?

Christian Tanzer tanzer at swing.co.at
Wed Nov 28 13:03:55 EST 2001


>     Is there a way to intercept the activation of messages which are
> not implemented?
> 
>     For those of you Smalltalkers, I'm talking about
> #doesNotUnderstand:
> 
>     In smalltalk, if you send a message to an object, but the object
> has no implementation for it, it'll receive a doesNotUnderstand
> messasge, with the failed message as argument. You can use this
> mechanism to implement proxies or auto accessors, or a lot of other
> interesting things...

`__getattr__` is your friend.

-- 
Christian Tanzer                                         tanzer at swing.co.at
Glasauergasse 32                                       Tel: +43 1 876 62 36
A-1130 Vienna, Austria                                 Fax: +43 1 877 66 92





More information about the Python-list mailing list