A small inconsistency in syntax?
Greg Ewing
greg at cosc.canterbury.ac.nz
Thu Oct 25 22:27:02 EDT 2001
Terry Reedy wrote:
>
> An so it is. If the patterns do not match, an exception is raised.
> However, after the match, the names (in your example above) 'time',
> 'status', 'value', and 'boring' are then bound to the corresponding
> objects in the current namespace.
In the case in question, i.e.
() = ()
the patterns clearly do match. And, every name in
the LHS has a corresponding value in the RHS. The
numbers of both these things happen to be 0, but
so what?
I think Michael Abbot is quite right. There's no
reason this shouldn't be a legitimate, albeit
degenerate, case of tuple unpacking.
--
Greg Ewing, Computer Science Dept, University of Canterbury,
Christchurch, New Zealand
To get my email address, please visit my web page:
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list