Hi, PyPy people, What do you think about this Signature PEP? http://mail.python.org/pipermail/python-3000/2006-April/001249.html PyPy has something similar as pypy.interpreter.pycode.cpython_code_signature, and I think it's definitely a good idea to have some better interface than code.co_* and CO_FLAGS. http://codespeak.net/svn/pypy/dist/pypy/interpreter/pycode.py We also have more extensive interface in pypy.annotation.description: http://codespeak.net/svn/pypy/dist/pypy/annotation/description.py There's FunctionDesc, ClassDesc, and MethodDesc there. Though they are quite PyPy-specific. Seo Sanghyeon
Hi Seo, On Tue, May 02, 2006 at 04:02:46PM +0900, Sanghyeon Seo wrote:
What do you think about this Signature PEP? http://mail.python.org/pipermail/python-3000/2006-April/001249.html
It's a language design issue so it's off topic :-) More seriously, sure, it would be nice to have some kind of standard. Here, and in many similar code-manipulation places in PyPy, we had to hack together our own minimal solution. A harder problem along these lines would be a better way to build pieces of code, in order to create functions from scratch. \n-joining together source lines full of %s, avoiding name clashes, and getting the indentation right, is not fun. A bientot, Armin
Armin Rigo wrote:
Hi Seo,
On Tue, May 02, 2006 at 04:02:46PM +0900, Sanghyeon Seo wrote:
What do you think about this Signature PEP? http://mail.python.org/pipermail/python-3000/2006-April/001249.html
It's a language design issue so it's off topic :-)
More seriously, sure, it would be nice to have some kind of standard. Here, and in many similar code-manipulation places in PyPy, we had to hack together our own minimal solution. A harder problem along these lines would be a better way to build pieces of code, in order to create functions from scratch. \n-joining together source lines full of %s, avoiding name clashes, and getting the indentation right, is not fun.
I had a look a while ago at trying to build Python code using ASTs and then compile those, for this very reason. In the end constructing the source was easier, but in theory this is a code-based alternative Cheers David
participants (3)
-
Armin Rigo
-
David Fraser
-
Sanghyeon Seo