[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-24 Thread misha
Better yet: given point: as (x, 1): ... as (1, y): ... as None: ... ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/list

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-24 Thread misha
To me match also sound confusing as a keyword. You don't match things to cases in English. Maybe match x: against 1? https://idioms.thefreedictionary.com/match+against match point: against (x, 1): ... against (1, y): ... Better yet it feels to me to have: handle point:

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-24 Thread Misha Drachuk
I really dislike the fact that case with is instance check looks like instantiation. case Node(children=[…]) Along with checks for int or enum cases, "is instance” and attribute checks like the one above will be perceived as equality check. Basically what happens is based on context the round