3 ms·
Quite an epic effort, but (I'm guessing, due to the age of it) none of the type system stuff is checkable via mypy etc it seems like instead there's a bunch of
by anentropic 6y ago
Quite an epic effort, but (I'm guessing, due to the age of it) none of the type system stuff is checkable via mypy etc
it seems like instead there's a bunch of runtime type-checking going on (or at least... "at import time", i.e. runtime but as early as possible)
- zitterbewegung 6y agoREADME says Python 3.x support in the future and others have stated the library is inactive for five years .
- zanellia 6y agoIndeed, I guess much of the type annotation stuff would be much easier with type hints from Python 3.6+ (https://docs.python.org/3/library/typing.html https://docs.python.org/3/library/typing.html), plus it might add some level of compatibility with recently developed static analysis tools like mypy, pyright, pyre.
- anentropic 6y agoI have seen various efforts to do this stuff in a way that is checkable via mypy (i.e. using Python's own type system + as much dynamism is still type-able) and so far it looks like it's a much harder task These folks have several excellent projects in that direction though: https://github.com/dry-python/ https://github.com/dry-python/
- zanellia 6y agoThat'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.