A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-March/062218.html below:

[Python-Dev] Making builtins more efficient

[Python-Dev] Making builtins more efficient [Python-Dev] Making builtins more efficientJosiah Carlson jcarlson at uci.edu
Thu Mar 9 19:16:54 CET 2006
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

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4