[Python-au] Python New Class Features

Andrew Bennetts andrew-pythonau@puzzling.org
Fri, 17 Jan 2003 16:21:45 +1100

On Fri, Jan 17, 2003 at 03:57:17PM +1100, Graeme Matthew wrote:
> So would all of you agree that using slots to make sure the correct
> attributes are accessed and no additional attributes would be the way to go 
> ?

I'd say no :)

You never know how someone else might want to use your class/objects, so
unless there's a performance reason to do so, why bother?  Similarly, Python
doesn't make you declare your functions' variables and their types, because
it's simply unnecessary, and makes changing your code much more tedious (due
to having to update umpteen declarations everytime you want to try doing
things slightly differently).

This is largely a matter of personal preference, I guess, but my usual
inclination is to do the least amount of work :)