> для этих случаев придумали Rpython
> https://rpython.readthedocs.io/en/latest/rpython.html
> который совместим с python 2.7 конечно RPython придумка ученых (ну т.е. для конкретной реализации пинали ассистентов и студентов, все как обычно) исследоваших "динамические языки программирования".
Поэтому RPython -- фреймворк для написания интерпретаторов дин. ЯП. (в первую очередеь PyPy) с кучей плюшек и автомагии, но не с (первоочередной) целью решения каких-то конкретных "реальных" задач.
И уж конечно, он не совместим с python2.7 - там строго типизованное подмножество.
https://rpython.readthedocs.io/en/latest/faq.html#what-is-rp...
> What is RPython?
> RPython is a framework for implementing interpreters and virtual machines for programming languages, especially dynamic languages.
.
> Can RPython compile normal Python programs to C?
> No, RPython is not a Python compiler.
> In Python, it is mostly impossible to prove anything about the types that a program will manipulate by doing a static analysis. It should be clear if you are familiar with Python, but if in doubt see [BRETT].
.
> Do I have to rewrite my programs in RPython?
> No, and you shouldn’t try. First and foremost, RPython is a language designed for writing interpreters. It is a restricted subset of Python. If your program is not an interpreter but tries to do “real things”, like use any part of the standard Python library or any 3rd-party library, then it is not RPython to start with. You should only look at RPython if you try to write your own interpreter.