I was actually thinking of some of the subclasses that already implement a
__getattr__ method to expose some of the widget structure members.  For
these currently it raises an exception if it doesn't recognise an
attribute name.  The change would be for it to call its superclass's
__getattr__ method when this happens.

James Henstridge.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


On Thu, 18 Feb 1999, Aaron Optimizer Digulla wrote:

> Quoting James Henstridge <[EMAIL PROTECTED]>:
> 
> > Just as an idea, what would people think about using the __getattr__ and
> > __setattr__ functions to get and set widget data.  This would require
> > altering the current __getattr__ routines to call their parent's
> > __getattr__ method for unknown attributes.  This would fix most of the
> > wierdness people encounter in pygtk.
> >
> > What do people think?
> 
> That would be *great*. It would make Gtk behave much more "pythonian".
> And I don't think that you have to alter __getattr__: If __getattr__ calls
> wid.get_data(tag), then this works no matter in which level the custom
> attribute has been set and if it's a attribute of the class, then
> Python won't call __getattr__ for it (__getattr__ is only called if an
> attribute is not known).
> 
> --
> Aaron "Optimizer" Digulla             Team AMIGA     AROS Head of Development
> Author of XDME, ResTrackLib, CInt.                   <http://www.aros.org/>
> "(to) optimize: Make a program faster by improving the algorithms rather than
> by buying a faster machine."                               <[EMAIL PROTECTED]>
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
> 

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to