On Tue, Jun 23, 2020 at 10:10 AM MRAB <python@mrabarnett.plus.com> wrote:
Why are:

     case ._:

not OK?

In this:

     case .BLACK:
         ...
     case BLACK:
         ...

the first matches the value against 'BLACK' and the second succeeds and
binds the value to 'BLACK'.

Replacing 'BLACK' with '_':

     case ._:
         ...
     case _:
         ...

I'd expect something similar, except for the binding part.

I think the same could be said for:

     case Color.BLACK:

and:

     case _.BLACK:

The PEP authors discussed this last night and (with a simple majority) we agreed that this restriction isn't all that important, so we're dropping it.
https://github.com/python/peps/commit/410ba6dd4841dc445ce8e0cd3e63ade2fa92ddc4

(We're considering other feedback carefully, but most of it require more deliberation.)

--
--Guido van Rossum (python.org/~guido)