New statement proposal for Python
jeremy at alum.mit.edu
Wed Jun 20 04:12:08 CEST 2001
Tim Peters wrote:
> [Greg Ewing]
>>Instead of introducing a new syntax, however, I'd rather
>>see some work done on the implementation of module
>>namespaces to make them more like local namespaces
>>are now -- i.e. so that names the compiler knows about
>>are accessed by indexing into an array instead of
>>looking up a dictionary.
>>I think this would be a much more worthwhile investment
>>of effort, since it would benefit *all* accesses to
>>globals, not just "constant" ones!
> I agree. Jeremy was looking into this seriously, but the month he
> to work on it got lost when paternity leave came a month earlier than
> planned. So, blame God or not, but there's no bandwidth at PythonLabs to
> look into this now. Would still make a good PEP.
I posted some notes on python-dev for a PEP I was working on before the
Subject: pre-PEP on optimized global names
I think the draft I posted there doesn't go into much detail about the
changes to the interpreter internals. I think there are a lot of issues
there, not least of which is that there is no builtin dictionary type that
represents the globals of a module. This is one instance of many changes
that programmers using the C API would need to cope with.
Perhaps 2.2 is the right time to make these changes, since the C API will
probably change a lot anyway. I don't know what the PEP deadline or alpha
release schedule is for 2.2, so it's hard to say if it's too late.
If someone wants to pick up these notes and draft a full PEP, I'd be
thrilled. I can't promise much help, although I'd like to.
More information about the Python-list