On 30/10/2020 4:09 pm, Brandt Bucher wrote:
Can we discuss whether we want pattern matching in Python and the broader semantics first, before dealing with low level details?
This is a huge step backward. These discussions have already taken place, over the last 10 years.
So what you are saying is that I'm not allowed to voice my opinions, because it is outside a time frame of your choosing?
Here's just a sampling:
We read all of these and more back way in March, before we even started brainstorming syntax and semantics.
Do we want a fancy switch statement, or a powerful expression?
It's right here that you lose me. Anyone who reduces pattern matching to "a fancy switch statement" probably isn't the right person to be discussing its semantics and usefulness with. It seems that some people just can't separate the two ideas in their mind. It's like calling a class a "fancy module".
Pattern matching is a fancy switch statement, if you define "fancy" appropriately ;)
Reducing pattern matching to some sort of switch statement is exactly what a good implementation should do. It's what compilers are for. The comparison seems entirely reasonable to me.
OOI, what is the reasoning for choosing a statement, not an expression?
It's okay that you feel that way, but hopefully you'll understand if people start to tune out messages that contain these sorts of comments.
What does "these sorts of comments" mean? Ones that you disagree with?
If I am wrong, please explain why in an as objective a fashion as possible.
What special method(s) should be added?
None. PEP 622 originally added one, but even that is more than we need right now. Some people may need to register their mappings or sequences as Mappings or Sequences, but otherwise that's it.
Much of the language uses special methods. Why should pattern matching be so different?
Why make this opt-out, rather than opt-in, given the potential for unwanted side effects?
I would ask anyone who wants pattern matching adding to Python, to not support PEP 634.
Yes. Absolutely. PEP 634 is seriously flawed.
I would ask anyone who wants pattern matching added to Python to carefully consider the PEPs for themselves (particularly PEP 636, which is much less dry and contains more examples and commentary). We've written four of the largest, most detailed PEPs of any new feature I've seen, complete with a working implementation that we've made available from any browser. Of course it's not the *only* way of getting pattern matching... but if you want it, this is probably your *best* shot at getting it.
Given the size of the proposed change to the language, it really isn't that detailed.
The browser based implementation is nice, though :)
Brandt _______________________________________________ Python-Dev mailing list -- firstname.lastname@example.org To unsubscribe send an email to email@example.com https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://firstname.lastname@example.org/message/DEUZMFMT... Code of Conduct: http://python.org/psf/codeofconduct/