Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

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

Open
ShadowJonathan opened this issue Feb 10, 2021 · 0 comments
Labels
T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Comments

@ShadowJonathan
Copy link
Contributor

(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.

@ShadowJonathan ShadowJonathan changed the title Unignore and enforce check E731 Unignore and enforce check E731 ("Do not assign a lambda expression, use a def") Feb 10, 2021
@erikjohnston erikjohnston added the T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. label Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Projects
None yet
Development

No branches or pull requests

2 participants