George Sakkis wrote:
> "Aahz" <[EMAIL PROTECTED]> wrote:
> > In article <[EMAIL PROTECTED]>,
> > Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> > >
> > >The proposed names could possibly be improved (perhaps tally() is
more active
> > >and clear than count()).
> >
> > +1 tally()
>
> -1 for count(): Implies an accessor, not a mutator.
> -1 for tally(): Unfriendly to non-native english speakers.
> +0.5 for add, increment. If incrementing a negative is unacceptable,
how about
> update/updateby/updateBy ?
> +1 for accumulate. I don't think that separating the two cases --
adding to a scalar or appending to
> a list -- is that essential; a self-respecting program should make
this obvious by the name of the
> parameter anyway ("dictionary.accumulate('hello', words)" vs
"a.accumulate('hello', b)").

What about no name at all for the scalar case:

a['hello'] += 1
a['bye'] -= 2

and append() (or augmented assignment) for the list case:

a['hello'].append(word)
a['bye'] += [word]

?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to