I really like this style of programming, especially after fooling around with 
Rust a lot,
where pattern matching and its variations, like "if let" are working really 
well. 

I also like the idea of using the walrus operator in this use case, while it is 
probably up 
for a lot of discussing if the walrus operator should/can be reimplemented like 
this. 

With this pattern matching movement (PEP 622, 634, 636) this idea fits right in.

A downside IMO is the readability. In the patter matching proposed in PEP 636, 
we
introduce verbosity, while preserving readability. Every case is clearly 
readable. 

In your example I had to look twice that the 'Response' is the pattern which is 
matched 
from the 'get' result.

But in the end this argument also applies to the already implemented walrus 
operator, so there is that.

Patrick
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/XOO5E4U4KBJ7O4EC4H7MKQYRKFU3SHPW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to