mirror of https://github.com/zulip/zulip.git
6988622fe8
Python’s loop scoping is misdesigned, resulting in a very common gotcha for functions that close over loop variables [1]. The general problem is so bad that even the Go developers plan to break compatibility in order to fix the same design mistake in their language [2]. Enable the Ruff rule function-uses-loop-variable (B023) [3], which conservatively prohibits functions from binding loop variables at all. [1] https://docs.python-guide.org/writing/gotchas/#late-binding-closures [2] https://go.dev/s/loopvar-design [3] https://beta.ruff.rs/docs/rules/function-uses-loop-variable/ Signed-off-by: Anders Kaseorg <anders@zulip.com> |
||
---|---|---|
.. | ||
actions | ||
data_import | ||
integration_fixtures/nagios | ||
lib | ||
management | ||
migrations | ||
openapi | ||
tests | ||
tornado | ||
transaction_tests | ||
views | ||
webhooks | ||
worker | ||
__init__.py | ||
apps.py | ||
context_processors.py | ||
decorator.py | ||
filters.py | ||
forms.py | ||
logging_handlers.py | ||
middleware.py | ||
models.py | ||
signals.py |