Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python.2: fix tests, use source checkers and more python3 features
Check the whole code with flake8, pylint and mypy. Report all possible errors with extensive context. Demonstrate iterators, decorators, functional tools, chain maps, dataclasses, match statements, assignments expressions. Implement environments with python chain maps. Rewrite the reader without external dependencies (but inspired by the ptk library). The motivation was that no external library is fully type-checked for now. Avoid name clashes when possible (print, read, readline, types). Write the readline history file at exit, not after each prompt. Replace printer.pr_str as methods of MAL objects. This is idiomatic python, and improves the error reporting. Change some representations so that the python equality matches the MAL equality. The recursion is now implicit. Remove -O from ./run. It took me a while to understand that run-time assertions were disabled! MAL is about development, not performance. Dispatch the special forms from a dict, for readability (pylint rightfully complains that there are too many return statements in eval_()). Copy the recursion overflow fix, the python interaction from the first python implementation. Add tests detecting that nil false 0 () [] "" are distinct, and that 0 () are not False when tested (in python False == 0 and an empty container is tested ). Add tests checking that metadata does not affect equality (they do with a naive python dataclass).
- Loading branch information