This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Programming FAQ - variables local to the lambdas
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.10
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Rainald Koch, SilentGhost, docs@python
Priority: normal Keywords:

Created on 2020-06-02 23:11 by Rainald Koch, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg370637 - (view) Author: Rainald Koch (Rainald Koch) Date: 2020-06-02 23:11
In section [10] of the FAQ, I whould add "(a function parameter with different default values)" after "variables local to the lambdas".

Besides, I had to look up "memoizing" [2] and suspect that "memorizing" would be correct.

[10] https://docs.python.org/3/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result
[2] https://en.wikipedia.org/wiki/Memoization
msg370640 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2020-06-03 05:24
I don't think your suggestion improve readability there. I think explanation following the code example does a decent job without being overly verbose.

Regarding, memoization, it is mentioned in [0], right after describing the technique. So, I'm not sure why you had to specifically look it up or why you still suspect that memorisation would be correct

[0]: https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects
History
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 85027
2020-06-03 16:50:00rhettingersetstatus: open -> closed
resolution: rejected
stage: resolved
2020-06-03 05:24:02SilentGhostsetnosy: + SilentGhost
messages: + msg370640
2020-06-02 23:11:05Rainald Kochcreate