3 ms·
That's quite interesting. I guess one could try to do something even cleaner than this https://github.com/dry-python/classes https://github.com/dry-python/class
by zanellia 6y ago
That's quite interesting. I guess one could try to do something even cleaner than this https://github.com/dry-python/classes https://github.com/dry-python/classes using type hints only and code transformation based on Python ASTs (see e.g. https://github.com/berkerpeksag/astor https://github.com/berkerpeksag/astor). I have done something similar for (typed) Python-to-C transpilation for fun (https://github.com/zanellia/prometeo https://github.com/zanellia/prometeo), but, now that I think about it, it could be used to implement typed polymorphism for Python classes quite easily.