Multi-argument append() is illegal

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

On Mon, 28 Feb 2000 10:41:02 -0500, Guido van Rossum <guido at> 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           | In the End,
  "Join the secret struggle for the soul of the world." | Oblivion
  Nobilis, a new Kind of RPG                            | Always                                | Wins

More information about the Python-list mailing list