On 06/24/2020 08:57 AM, mi...@drach.uk wrote:

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

Python uses English words, but is not English.

Having said that, you can "match against several cases" to see which one is 
what you are looking for:

Google search, not sure which dictionary, said:
noun: case; plural noun: cases
1.
an instance of a particular situation; an example of something occurring.


So in your example we have three cases of interest:
- point is Point(?, 1)
- point is Point(1, ?)
- point is None

So we are matching the point given against three different cases, and

match <thing>:
    case <1>:
        # blah
    case <2>:
        # blah
    case <3>:
        # blah

flows naturally from that.

--
~Ethan~
_______________________________________________
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/SOPKK3W2GC5XRN7KPSDP55V6IRZ5OIAK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to