pythonic way to optimize access to imported value?

Gerhard Häring gerhard.haering at gmx.de
Wed Nov 13 04:33:52 EST 2002


Lexy Zhitenev wrote in comp.lang.python:
> "Greg Ewing" <see_reply_address at something.invalid> wrote:
>> ... Maybe
>>
>>     def foo():
>>        const m = math
>>        return m.pi
>>
>> The "const" statement would be evaluated when
>> the "def" was executed, and "m" would appear in the
>> local namespace when the function was called.
>>
>> Although "const" might not be the best name for
>> it, since it's not really a constant, more like
>> a local with an initial value.
>>
> 
> What is this 'const' name? I haven't ever heard of this in Python.

It doesn't exist. Greg was talking about a possible language
extension.

-- Gerhard



More information about the Python-list mailing list