On Wed, 24 Jun 2020 at 07:40, Ethan Furman <et...@stoneleaf.us> wrote:
> Second premise:  there is no practical difference between
>
>      match color:
>          case BLACK:
>              # do stuff
>
> and
>
>      match color:
>          case _:
>              BLACK = color
>              # do stuff

You've already changed your position, so this is only marginally
relevant now, but if the match expression is long and complex,
duplicating it is messy. Using the walrus operator is an alternative,
but it's not clear to me how readable that would be if it were only
needed for one case out of many. I'd need to see a "real" example to
have a good feel on that.

(FWIW, I do find that with my ageing eyes, it's easy to miss the dot
prefix. And I feel that the use of a dot would make Uncle Timmy sad
:-()

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

Reply via email to