FAQ

(and no, it hasn't been fixed. I doubt it can be
fixed without breaking stuff).
Mmm??? Are there a line of code that *relies* on that misfeature?
yes, there are tons of code that relies on the
fact that the default values are evaluated once,
and more importantly, that they are evaluated
in the namespace where the function/lambda
is defined.

in fact, it's currently the only reasonable way
to pass local variables into a nested namespace
(like when using lambdas). it's also often used
to speed things up, by binding commonly used
globals to local names.

...

but sure, I'm sure Guido is open for proposals. I
don't think you can get away with "always evaluate
them on each call," though...

</F>

<!-- coming monday:
http://www.pythonware.com/people/fredrik/librarybook.htm
(the eff-bot guide to) the standard python library. -->

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 12 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedOct 17, '99 at 12:47a
activeOct 27, '99 at 7:30p
posts12
users6
websitepython.org

People

Translate

site design / logo © 2021 Grokbase