This one is new but I think unrelated and unmentioned: Why is the mapping match semantics non-strict about keys? Besides the "asymmetry" with sequence matches, I think a strict match should be useful sometimes (quickly deconstructing JSON data comes to my mind, where I want to know that I didn't get unexpected keys). I cannot get that behaviour with the current pep. But if we make key strictness the default, I can always add **_ to my mapping pattern and make it non strict (that's currently forbidden but the restriction can be lifted). Is there an assumption (or even better, data evidence) that non-strict checks are much much more common?
A similar but weaker argument can be made for class patterns (although I can imagine non-strict matches *are* more common in that case). Mostly but not completely unrelated to the above, and purely syntactic sugar bikeshedding, but I think having "..." as an alias for "*_" or "**_" (depending on context, and I'd say it's *both* inside a class pattern) could make these patterns slightly more readable. Best, D. On Wed, 24 Jun 2020 at 20:44, Guido van Rossum <gu...@python.org> wrote: > Everyone, > > If you've commented and you're worried you haven't been heard, please add > your issue *concisely* to this new thread. Note that the following issues > are already open and will be responded to separately; please don't bother > commenting on these until we've done so: > > - Alternative spellings for '|' > - Whether to add an 'else' clause (and how to indent it) > - A different token for wildcards instead of '_' > - What to do about the footgun of 'case foo' vs. 'case .foo' > > (Note that the last two could be combined, e.g. '?foo' or 'foo?' to mark a > variable binding and '?' for a wildcard.) > > -- > --Guido van Rossum (python.org/~guido) > *Pronouns: he/him **(why is my pronoun here?)* > <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> > _______________________________________________ > Python-Dev mailing list -- python-dev@python.org > To unsubscribe send an email to python-dev-le...@python.org > https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/STJSSAETMTUY7FK5AE53IM73Z2WORNYN/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/DS26FCVJ2FCQBRK6OQEBIKYBZPXIIY5P/ Code of Conduct: http://python.org/psf/codeofconduct/