Danny Milosavljevic <[EMAIL PROTECTED]> writes:

> Hi,
> 
> Am Donnerstag, den 26.05.2005, 13:33 -0500 schrieb Doug Quale:
> > Danny Milosavljevic <[EMAIL PROTECTED]> writes:
> > 
> > > Any ideas ?
> > 
> > Don't use __slots__ :-)
> > 
> > This is actually a serious suggestion.  They are a performance hack
> > and aren't usually needed.
> 
> Well I dont want to use it for performance reasons but rather for code
> quality reasons (that is, to prevent myself from having random new
> 'not-quite-member variable' attributes appear in objects over time)
> 
> If there is another way to safeguard that objects only have the members
> they .. well... have (as defined in sourcecode with the class
> declaration), please tell me :)

That's certainly sensible, and it's a common reason to want to use
__slots__.  I think "pychecker -a" might help.  You can also look at
pylint.

Someone else here may have some suggestions, since this is probably a
python FAQ.
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to