ITADN

`WPS617` false positive with keyword args

#3596Opensobolevn 创建于 2026-02-10
bughelp wantedlevel:startergood first issue
S
sobolevncommented
```python self._media_by_precedence = sorted( ( media_type for parser in self._parsers.values() if (media_type := MediaType(parser.content_type)).quality != 0 ), key=lambda media: (media.specificity, media.quality), # noqa: WPS617 reverse=True, ) ``` It says: ``` django_modern_rest/negotiation.py 52:17 WPS617 Found lambda assigned as an attribute key=lambda media: (media.specificity, media.quality), ^ ``` Which is clearly a bug, it is a named param, not an attribute. PRs are welcome, this is easy to fix.
1 条评论