[Python-Dev] PEP 329: Treating Builtins as Constants in (original) (raw)
Jewett, Jim J jim.jewett at eds.com
Tue Apr 20 11:58:44 EDT 2004
- Previous message: [Python-Dev] Re: [Python-checkins] python/nondist/peps pep-0329.txt, 1.2, 1.3
- Next message: [Python-Dev] Re: Decimal data type issues
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Brett Cannon wrote:
foo = len(x)
which loads len (global), loads x (local), calls len, and then stores into foo (local). ... storing built-ins into the local namespace to skip having to try load from the global namespace, fail, and then check the built-in namespace
An in-between option would be to steal an idea from Jython, and to make (some?) namespace dictionaries different from regular dictionaries. Not only do we know what sorts of keys are possible, we almost know what every key is at compile time.
-jJ
- Previous message: [Python-Dev] Re: [Python-checkins] python/nondist/peps pep-0329.txt, 1.2, 1.3
- Next message: [Python-Dev] Re: Decimal data type issues
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]