On Fri, Feb 22, 2008 at 7:44 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote:
[... del (tuple, of, variables), etc deleted] > > > I also think > > > > del a, > > > > should not be legal ("SyntaxError: trailing comma not allowed without > > surrounding parentheses"?), but that's getting into my own personal > > preferences. > > These all make sense to me, but at the same time it seems such a minor > issue that I'm not sure we should bother. It would probably end up > being more custom syntax -- right now it just uses exprlist in the > grammar and is limited to assignment targets by the compiler. What bothers me more is assert of a tuple. It does the wrong thing from what newbies expect. pychecker warns about this, but the version of pylint in use at Google doesn't warn about this. I wonder if we should add a warning? The code I recently saw was: assert (something_short, 'Some long assertion string that needs its own line') The original code that pylint warned about was: assert something_short, \ 'Some long assertion string that needs its own line' Index: Python/compile.c =================================================================== --- Python/compile.c (revision 61058) +++ Python/compile.c (working copy) @@ -2056,6 +2056,9 @@ if (assertion_error == NULL) return 0; } + if (s->v.Assert.test->kind == Tuple_kind) { + printf("got a tuple\n"); + } VISIT(c, expr, s->v.Assert.test); end = compiler_new_block(c); if (end == NULL) Seems to do the trick. Maybe this should be turned into a real patch with using PyErr_Warn()? n _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com