ruff
d36f6099 - Ignore annotated lambdas in class scopes (#10720)

Commit
2 years ago
Ignore annotated lambdas in class scopes (#10720) ## Summary An annotated lambda assignment within a class scope is often intentional. For example, within a dataclass or Pydantic model, these are treated as fields rather than methods (and so can be passed values in constructors). I originally wrote this to special-case dataclasses and Pydantic models... But was left feeling like we'd see more false positives here for little gain (an annotated lambda within a `class` is likely intentional?). Open to opinions, though. Closes https://github.com/astral-sh/ruff/issues/10718.
Author
Parents
Loading