I can, but it seems like the wrong usage of pattern matching and it requires 
much more code.
```
match m:
    case {"a": a, "b": b, **rest}:
        pass
    case _:
        raise ValueError
```

We can use pattern matching to unpack sequences, but we have special syntax for 
this:
```
s = range(100)

match s:
    case (a, b, *rest):
        pass
    case _:
        raise ValueError

(a, b, *rest) = s  # solve same problem with one line
```
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/GCMKZFHIB5S6DT24HZ42WLEUBMGTGJKU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to