On Dec 18, 2007 7:31 AM, Calvin Spealman <[EMAIL PROTECTED]> wrote: > I just had an issue brought up by another developer who had a > trailing comma on an assignment causing a 1-tuple he did not expect. > We were talking about it and came to the conclusion that it is at > least worth bringing up the idea of enforcing a SyntaxError in the > case of this. 1-tuple syntax is already an odd-man-out, so requiring > more explicitness about it would catch some errors and be more > readable. I think we could agree that a tuple of 2 or more elements > is much easier to read without parens than a 1-tuple without parens. > Aside from assignment I can't think of a single place when one would > construct a 1-tuple without parens. > > This is the offending erroneous and hard-to-catch code: > > if foo: > bar = 3, > L = [1, > 2, > bar] > > Would there be any possibility in considering further refining the 1- > tuple syntax to require parens because of its nature?
Why don't you try to come up with a patch to see how feasible this is? -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com