ins always C extensions (even on PyPy)?
I'm working on a documentation API for Python I'm calling Python Docs, and I've noticed that almost all built-ins can't be accessed by my static analysis suite, because they are almost exclusively C modules. As far as I can remember, I can't think of any exceptions to this rule.
The first part of my question is simply, does being a built-in module presuppose being a C-extension in CPython?
Assuming that this might be the case, I compiled a fresh pypy runtime and tried using my project against with the built-ins from pypy. I was surprised to find that this didn't work either.
Why aren't PyPy modules available AST objects if they're pure Python? Is this a side-effect of PyPy being hosted on a JIT?
PyPy is two parts -- the Python interpreter and the translation toolchain.
The translation toolchain translates / "compiles" the interpreter from RPython into machine code.
So although PyPy is written in a language that is a subset of Python, it's not Python when you use it.
You should read the compiler section of the PyPy Parser docs and this blog post that describes that the AST features in PyPy mirror those in CPython.
链接地址: http://www.djcxy.com/p/58546.html上一篇: 从IME打开区分常规菜单KeyEvent
下一篇: 总是C扩展(即使在PyPy上)?