A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-July/007036.html below:

[Python-Dev] Computed-attributes

[Python-Dev] Computed-attributesDonald Beaudry Donald Beaudry <donb@init.com>
Thu, 20 Jul 2000 15:48:45 -0400
Paul Prescod <paul@prescod.net> wrote,
> Donald Beaudry wrote:
> > The cost is some additional burden on the writer of the __attr_XXX
> > method (and some magic to distinguish the del case).
> 
> Don't follow that. Why not just have "get"/"set"/"del" opcodes?

Sorry about that... it was an editing problem.  At first I was going
to propose that the __attr_XXX method take just one optional argument:
the set value.  If it was there do a set, if not do a get.  The
problem was how to do the del (magic?).  Then I had the bright idea of
using the op parameter but never removed my "magic" comment.

The "additional burden" I was refering to was that of writing a method
which must first decide what to do.  Personally, I call this a feature
since it forces all maintenance of a given attribute into a single
place.  Others might argue that the code in a single purpose setter,
getter, or deller would read better.

--
Donald Beaudry                                     Ab Initio Software Corp.
                                                   201 Spring Street
donb@init.com                                      Lexington, MA 02421
                  ...So much code, so little time...





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4