On Dec 31, 2019, at 21:35, Guido van Rossum <gu...@python.org> wrote:
> 
> There were match proposals in the past — have you looked those up? Maybe they 
> solve your problem without that syntax — or maybe they would benefit from it. 

Most of the existing proposals require a lot more syntax—a new form using two 
or three new keywords or symbols, and often a new dunder protocol as well.

What I was trying to do this weekend was come up with something that reads as 
similarly as possible, with smaller changes to the language. The key is that 
before the walrus operator, it was hard to imagine how you could leverage 
if/elif chains (essentially the same way Python covers 90% of what C switch can 
do without needing a new structure) and tuple unpacking. Now it seems much more 
feasible. (Also, dataclass is close enough to a “case class”—and provides a 
model for building them manually—that the proposal no longer requires a new 
opt-in mechanism for simulating ADTs before it can even get off the ground.)
_______________________________________________
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/BZLEKPARSTANN46VMA6PHFZGNDRDT3ZJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to