On Wed, May 25, 2016 at 2:26 AM Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:

My feeling is that the patterns should look like
constructors. The archetypal constructor for a mapping
object is the dict display, so a pattern that matches
a mapping having particular keys would be

    case {"x": p, "y": q}:

This is starting to look really good to me. But if that's valid in a case statement, why not in a regular assignment?

    (a, b, *rest) = sequence
    {'x': p, 'y': q, **rest} = mapping