Accessors in Python (getters and setters)
Alex Martelli
aleax at mac.com
Thu Jul 13 11:09:14 EDT 2006
Gerhard Fiedler <gelists at gmail.com> wrote:
> On 2006-07-13 01:50:18, Alex Martelli wrote:
>
> >> I'm not sure about which languages you are talking (pretty much all that
> >> allow public methods also allow public attributes), [...]
> >
> > Smalltalk is a very well known object-oriented language that behaves
> > otherwise, just as one example.
>
> I didn't know that Smalltalk allows any methods at all... I wrote about
> languages that allow public methods, and I didn't think of Smalltalk
> falling into that category.
??? Smalltalk ONLY has methods -- no other "functions" or "procedures",
ONLY "methods". The one and only way you interact with an object is by
sending it a message to invoke a method -- that's what's known in most
other languages as "calling a method" (or "calling a function"). And
there is no such thing as a "nonpublic" method either, AFAIK (my
Smalltalk may be rusty, but there surely weren't in the Smalltalk I
learned years ago).
Alex
More information about the Python-list
mailing list