is Python fully object oriented ?

Alex Martelli aleaxit at yahoo.com
Fri Jan 12 03:27:13 EST 2001


"Issac Trotts" <trotts at mit.edu> wrote in message
news:mailman.979283415.13138.python-list at python.org...
    [snip]
> I don't know if this helps, but it's perfectly legal to use a name other
> than "self" in Python, e.g.,
>
> class SpamChunk:
>   def __init__(s):
>     s.color = 'green'

Yes, but it's a horrid idea to actually _make use_ of this
freedom.  I *strongly* suggest you adhere to whatever
"universal coding conventions and idioms" happen to be
prevalent in the language you're currently using, whenever
you're lucky enough to be using a language where a certain
usage _is_ well-nigh universal.

There are strong 'network externalities' (an economics
term, describing a situation where everybody is better
off by using 'interchangeable/interoperable' "stuff")
in universal coding conventions.  Calling 'self' exactly
that in Python is one such situation... don't "obfuscate"
your code for the sake of saving 3 characters here and
there!-)


Alex






More information about the Python-list mailing list