Multi-argument append() is illegal

Alexander Williams thantos at chancel.org
Mon Feb 28 21:05:29 EST 2000


On Mon, 28 Feb 2000 10:41:02 -0500, Guido van Rossum <guido at python.org> wrote:
>I am going to rectify this in Python 1.6 -- people coming from other
>languages might well expect list.append(a, b, c) to mean the same as
>list.append(a); list.append(b); list.append(c), and it's always been
>my philosophy to make ambiguous syntax illegal rather than to pick one
>interpretation randomly.

This would seem to violate the Principal of Least Surprise, at least
when considering the rest of the language.  Unless you also start
requiring the presence of parens on every other construction of a
tuple (as in:

   >>> a, b, c = string.split("1 2 3")

) you're introducing inconsistancy with Python in general.

Just another thought.

-- 
Alexander Williams (thantos at gw.total-web.net)           | In the End,
  "Join the secret struggle for the soul of the world." | Oblivion
  Nobilis, a new Kind of RPG                            | Always
  http://www.chancel.org                                | Wins



More information about the Python-list mailing list