4 ms·
If you want it today, Pampy does most of it: https://github.com/santinic/pampy https://github.com/santinic/pampy Even match on Point(x, y, _)
by csantini 6y ago
If you want it today, Pampy does most of it:
https://github.com/santinic/pampy https://github.com/santinic/pampy
Even match on Point(x, y, _)
- cobby 6y agoHow did they implement Point(x, y, _) matching? PEP proposes a special protocol [1] based on __match__ classmethod. Do they do something similar? [1] https://www.python.org/dev/peps/pep-0622/#runtime https://www.python.org/dev/peps/pep-0622/#runtime
- carapace 6y agoWow, that's way cooler than the PEP! "You can write a Lisp calculator in 5 lines" Oh my!
- JNRowe 6y agoThere is also switchlang¹ which isn't quite the same thing, but provides some of the functionality of PEP-622 and pampy. I believe it is notable for including a nice descriptive README, and also having a small/simple implementation. I personally prefer the pampy internals, but quite like the context manager usage from switchlang. I don't even know which bikeshed I want to paint, let alone the colour. 1. https://github.com/mikeckennedy/python-switch https://github.com/mikeckennedy/python-switch