element-hq / element-hq/synapse
Unignore and enforce check E731 ("Do not assign a lambda expression, use a def")
- 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
Assessment
This issue has not been assessed yet.