[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-24 Thread Taine Zhao
> e.g., "or", and then I wonder "what does short-circuiting have to do
> with it?". All reuse of symbols carries baggage.

"or" brings an intuition of the execution order of pattern matching, just like 
how people already know about "short-circuiting".

"or" 's operator precedence also suggests the syntax of OR patterns.

As we have "|"  as an existing operator, it seems that there might be cases 
that the precedence of "|" is not consistent with it in an expression. This 
will mislead users.

You said "All reuse of symbols carries baggage", I'd say,

All **inconsistent** reuse of symbols carries baggage,  but the consistent 
reuse builds good intuitive sense and shows the good taste of designers.
___
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/LVZPTOGDX6WCWZZV6T7QDL2MLDRFOXDA/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-24 Thread Taine Zhao
Thanks a lot for making this. I've been keeping excited since I heard this 
several hours ago!

I'm a researcher(and also a student) in some field dedicated in the study of 
programming language constructs, including pattern matching.

**Python Pattern Matching** is something special to me, which finally shaped 
the route of my life.
I'd say the design is quite clean and impressive, however still, I found many 
issues, and I wrote a blog post for this, in order to present my points clearly 
to you promoters and developers of PEP 622:
https://thautwarm.github.io/Site-32/Design/PEP622-1.html

The summary of the key points in my blog post:

1. There is a scoping issue which is not specified to be solved in the 
specification of PEP 622, and can be a dangerous bug.
2. The reason for accepting AND patterns, and its use case for enhancing the 
composability of programs.
3. Guards as patterns can be useful for pattern matching in Python.
4. An alternative '__match__' protocol which can be beneficial.
5. Reason for voting 'else' clause, just like Ethan and other kind people 
proposed.

I also feel like to implement PEP 622, and I'm familiar with steps concerning 
the implementation.
___
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/JTXWUF3IJ3FQQVSCKU2VKVAV5E5ATD7O/
Code of Conduct: http://python.org/psf/codeofconduct/