Metaclasses?

Andrew Cooke andrew at andrewcooke.free-online.co.uk
Thu Apr 27 06:02:36 EDT 2000


In article <3906542D.62B94F17 at darmstadt.gmd.de>,
  Robb Shecter <shecter at darmstadt.gmd.de> wrote:
> Michael Hudson wrote:
[...]
> Choice A:  Have a smalltalk-like instance variable declaration.
[...]
> to say that I like "Choice A".  I come from Java, and it did bug me a
> bit that there was no one easy place to see what instance variables a
> class has.  It made understanding the XML parser source code harder,
for
> example.

this doesn't really save typing - instead of typing self you have to
type the local declaration.  worse, this introduces extra syntax (after
all, you still need ".").

but more importantly, having "self" is good for the soul.  in most other
languages objects function in some "magical" manner.  having self makes
the mechanism clear - which is helpful both to newbies understanding OOP
for the first time, and to fools like me that get easily confused when
things happen behind their back...

andrew

ps it doesn't have to be "self", afaik - you could use just "s" to save
key presses.... :-)


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list