[DO-SIG] Re: [XML-SIG] foo.bar vs. foo.get_bar()

Fred L. Drake, Jr. fdrake@acm.org
Mon, 8 Nov 1999 10:11:20 -0500 (EST)


Martin v. Loewis writes:
 > 2. Choice of the specific names.
...
 >    The '_set_' and '_get_' prefixes don't create conflicts, since IDL
 >    identifiers must not start with underscores.

Martin,
  I think the _[gs]et_ *names* are ugly, but I do understand the
rationale, and I certainly don't have any better ideas about how to do 
it.  Paul has it right; Python needs to define computed attributes as
a language feature to all the creation of a "nice" way to do this.
  As far as expecting non-AttributeError exceptions, that's always a
possibility with __[gs]etattr__, and you shouldn't normally need to
know if an object is using that or not (unless you're subclassing).
So a programmer has to expect anything as it stands.


  -Fred

--
Fred L. Drake, Jr.	     <fdrake@acm.org>
Corporation for National Research Initiatives