On Fri, Feb 22, 2008 at 12:42 PM, Andrew Dalke
<[EMAIL PROTECTED]> wrote:
> On Feb 22, 2008, at 6:07 PM, Alexander Belopolsky wrote:
>  > Maybe Py3k should eliminate the list form, but allow empty tuples
>  > as useful in auto-generated code (deleting variable number of
>  > names.)
>
>  That seems pretty theoretical.  It's easy to add a "if has variables"
>  check first.  I looked at quite a few libraries grepping for unusual
>  del statements and didn't find any, including nothing like 'del []'
>
>  BTW, there's a bug in the error message for 'del ()'
>
>  Python 2.5 (r25:51908, Oct  9 2006, 13:24:22)
>  [GCC 3.4.6 [FreeBSD] 20060305] on freebsd6
>  Type "help", "copyright", "credits" or "license" for more information.
>
>  >>> del []
>   >>> del ()
>    File "<stdin>", line 1
>  SyntaxError: can't assign to ()
>   >>>

The only bug I see here is that it doesn't complain about "del []".

>  Python 3.0a2 (r30a2:59382, Feb 20 2008, 12:09:57)
>  [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
>  Type "help", "copyright", "credits" or "license" for more information.
>   >>> del []
>   >>> del ()
>  SyntaxError: can't assign to () (<stdin>, line 1)
>   >>>
>
>  This is the exception I want to see when someone does a destructuring
>  del, though with corrected wording.

I guess if you're really motivated to get this through, you'll have to
submit a patch, including unittests and doc updates.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to