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 -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/GCMKZFHIB5S6DT24HZ42WLEUBMGTGJKU/
Code of Conduct: http://python.org/psf/codeofconduct/