Evaluating python - a question

Alex Martelli aleaxit at yahoo.com
Fri May 18 09:09:59 EDT 2001


"Just van Rossum" <just at letterror.com> wrote in message
news:3B04EDEC.D1215440 at letterror.com...
    ...
> > A terminology issue: this seems to be about MUTATOR methods rather
> > than ACCESSOR ones.  ACCESSING a non-existent attribute raises an
> > exception just as much as calling a non-existent accessor method.
>
> Thanks for setting this straight: I thought the term accessor was used
> for both setting and getting. (Still, I think that setting an attribute
> is also a form of "access"...)

I'm not saying your terminology is "wrong", just trying to
clarify a likely misunderstanding due to terminology issues.

The definition of "accessor" in, e.g., the Java tutorial at
http://java.sun.com/docs/books/tutorial/java/data/accessors.html
"""
Methods used to obtain information about an object are known
as accessor methods
"""
is probably more widespread.


The alternative viewpoint, of using 'accessors' more widely
(leaving one without a simple way to name what the Java
people mean by 'accessors'...), is used for example at:
http://www.object-arts.com/EducationCentre/Patterns/AccessorMethods.htm
"""
So called accessor methods, provide a mechanism for getting
and setting the instance variables of an object
"""


Alex






More information about the Python-list mailing list