element-hq / element-hq/synapse

Unignore and enforce check E731 ("Do not assign a lambda expression, use a def")

Open
#9,369 0 comments 0 reactions 0 assignees View on GitHub
T-Task
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#9369](https://github.com/matrix-org/synapse/issues/9369).

---

(`E731` checks "Do not assign a lambda expression, use a def")

This check is voilated in only a few cases;
```
synapse/util/caches/descriptors.py:500:5: E731 do not assign a lambda expression, use a def
synapse/util/caches/descriptors.py:542:5: E731 do not assign a lambda expression, use a def
tests/server.py:332:9: E731 do not assign a lambda expression, use a def
```
The first to related to caching and then wrapping the callback functions in lambdas, and the last one being `ThreadedMemoryReactorClock.callFromThread`, I think it's better to remove this violation from the ignore list, and then to add `# noqa: E731` statements on those specific places.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.