[Python-bugs-list] [ python-Bugs-476858 ] Assignment to () should be legal (original) (raw)

noreply@sourceforge.net noreply@sourceforge.net
Wed, 31 Oct 2001 10:07:56 -0800


Bugs item #476858, was opened at 2001-10-31 10:07 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=476858&group_id=5470

Category: Parser/Compiler Group: None Status: Open Resolution: None Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Nobody/Anonymous (nobody) Summary: Assignment to () should be legal

Initial Comment:

From c.l.py:

Currently,

() = x

gives a compile-time error.

This should really be allowed (and require that x is an empty sequence, of course) as an end case of

(a,b,c) = x  # x must be a 3-sequence
(a,b) = x   # x must be a 2-sequence
(a,) = x    # x must be a 1-sequence
() = x    # why can't x be z 0-sequence?

You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=476858&group_id=5470