[Python-checkins] r43341 - in python/trunk: Lib/test/test_grammar.py Lib/test/test_inspect.py Python/ast.c

Guido van Rossum guido at python.org
Mon Mar 27 20:10:35 CEST 2006


On 3/27/06, Georg Brandl <g.brandl at gmx.net> wrote:
> This raises the question of why "def foo((x))" is allowed in the first place.
> It has no effect, and can really be confusing.

For the same reason you can write these:

  x = (1)
  (x) = 1
  for (x) in range(10): ...
  return (1)
  if (x): ...

IOW you should always be allowed to add redundant parentheses.

> The language ref doesn't tell anything about tuple unpacking arguments other
> than the grammar rules.

Please suggest improved language.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-checkins mailing list