Open GitRon opened 1 year ago
Hi, this actually crashed our code yesterday. Please try to to this only for objects that act like dicts. Maybe something in here can help to identify these structures? https://docs.python.org/3/reference/datamodel.html?emulating-container-types=#emulating-container-types
Example
Imagine this scenario:
If I run the linter, I get:
Which will obviously lead to a crash. I know that I wouldn't name a method
keys()
but still I think the rule might cause some problems.We need some check that it's really a dict if we want to auto-remove the keys...
Explanation
We might crash somebodys code when somebody is auto-fixing it (via ruff) or just blindly following the linter.