Why is the compiler package discontinued in Python 3?

前端 未结 3 959
不思量自难忘°
不思量自难忘° 2020-12-06 09:22

I was just pleasantly surprised to came across the documentation of Python\'s compiler package, but noticed that it\'s gone in Python 3.0, without any clear replacement or e

相关标签:
3条回答
  • 2020-12-06 09:28

    For what it's worth, I started a port of the compiler package to Python3: https://github.com/pfalcon/python-compiler . At the time of writing, it generates bytecode compatible with CPython3.5, and can compiler entire standard library of that version.

    0 讨论(0)
  • 2020-12-06 09:30

    To provide specific references to the decision trail:

    • https://mail.python.org/pipermail/python-3000/2007-May/007577.html
    • PEP 3108

    And, for what it's worth, I started Python3 port of the compiler package, to be maintained outside of the stdlib:

    • https://github.com/pfalcon/python-compiler
    • https://pypi.org/project/python-compiler/
    0 讨论(0)
  • 2020-12-06 09:35

    I believe the functionality is now built in:

    • compile
    • ast
    0 讨论(0)
提交回复
热议问题