Hi Brandt,

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:

- 
https://mail.python.org/archives/list/python-id...@python.org/thread/IEJFUSFC5GBDKFIPCAGS7JYXV5WGVAXP/
- 
https://mail.python.org/archives/list/python-id...@python.org/thread/GTRRJHUG4W2LXGDH4AU46SI3DLWXJF6A/
- 
https://mail.python.org/archives/list/python-id...@python.org/thread/EURSG3MYEFHXDDL2474PQNQZFJ3CUIOX/
- 
https://mail.python.org/archives/list/python-id...@python.org/thread/NTQEL3HRUJMULQYI6RDBTXQ2H3KHBBRO/
- 
https://mail.python.org/archives/list/python-id...@python.org/thread/NEC54II2RB3JRGHDP6PX3NOEALRAK6BV/
- 
https://mail.python.org/archives/list/python-id...@python.org/thread/T3VBUFECTLZMB424MBBGUHCI24YA4FPT/

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.

Seriously?

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 :)

Cheers,
Mark.



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

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

Reply via email to