[Python-Dev] PEP: source proposal (original) (raw)
holger krekel hpk at trillke.net
Sat Dec 4 09:59:38 CET 2004
- Previous message: [Python-Dev] PEP: __source__ proposal
- Next message: [Python-Dev] PEP: __source__ proposal
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Stelios Xanthakis Fri, Dec 03, 2004 at 11:59:30PM +0200]
On Fri, 3 Dec 2004, holger krekel wrote: >We are about to test out this approach with the py lib >(http://codespeak.net/py) and want to have it work for >for Python 2.2, 2.3. and 2.4.
Do you plan hacking python ? It appears that toknextc() is the best place to catch all the source passed to the interpreter.
Well, as we want to have the library work on past python versions modifying CPython 2.5 does not make much sense.
It's more about (like Martin pointed out) organizing dynamic code generation so that Python's introspect and traceback logic works as much as possible - with tiny runtime "monkey" patches if needed.
Now Martin also correctly pointed out that you can store
source code before/after you pass it to compile/parse.
We are doing this already with an external dictionary.
This has multithreading issues, though. So we think that
hooking onto code's objects co_filename or a module's file
might be an interesting idea.
cheers,
holger
- Previous message: [Python-Dev] PEP: __source__ proposal
- Next message: [Python-Dev] PEP: __source__ proposal
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]