[Python-Dev] Making builtins more efficient (original) (raw)
Josiah Carlson jcarlson at uci.edu
Thu Mar 9 19:16:54 CET 2006
- Previous message: [Python-Dev] Making builtins more efficient
- Next message: [Python-Dev] Weekly Python Patch/Bug Summary
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Steven Elliott <selliott4 at austin.rr.com> wrote:
I'm interested in how builtins could be more efficient. I've read over some of the PEPs having to do with making global variables more efficient (search for "global"): http://www.python.org/doc/essays/pepparade.html But I think the problem can be simplified by focusing strictly on builtins.
Whether or not it is a good idea, it is not wholly uncommon for users to manipulate variables in the builtin or other module namespaces. From very simple import hooks replacing import, to module.QUIT = 1, these things happen, and I don't think that making them produce a warning as suggested by Paul, necessarily helps us.
I personally think the problem can be simplified (and solved) by applying decorators where such builtin lookups could/should be more efficient. Raymond has a recipe for doing such optimization over at the Python cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940
Toss that little guy into a decorators module; if people want their runtime calling to be fast (at the expense of a slightly increased compilation time), they'll start using it.
- Josiah
- Previous message: [Python-Dev] Making builtins more efficient
- Next message: [Python-Dev] Weekly Python Patch/Bug Summary
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]