A cursory search of this thread suggests that no one has mentioned this yet, 
but apologies if I missed one of the existing replies about this.

In regards to 
https://www.python.org/dev/peps/pep-0622/#alternatives-for-constant-value-pattern,
 was this alternative considered?
```
match obj:
    case SomeClass(field := _):  # is this already allowed by the PEP?
        pass
    case some_constant:  # my proposal: do not require `.some_constant` here
        pass
    case (other := _):  # is this already allowed by the PEP? If so, do we need 
the extra `case other:` spelling?
        print(other)
```

It seems like `:=` already provides all the necessary syntax for distinguishing 
bindings from constants, admittedly at the cost of 6 characters per binding (eg 
`Point(x := _, y := _)`) - so introducing additional syntax seems unnecessary.
If this was considered but rejected for verbosity concerns, it would be nice to 
see it mentioned in the rejected alternatives section.

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

Reply via email to