You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the top example, ruff finds the error and can fix it automatically.
example.py:1:1: UP035 [*] Import from `collections.abc` instead: `Iterable`
In the bottom example, ruff doesn't find any error when it should have.
The code fails at runtime.
Traceback (most recent call last):
File "/home/username/example.py", line 8, in <module>
myfunction("string")
File "/home/username/example.py", line 4, in myfunction
if isinstance(arg, collections.Iterable):
^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'Iterable'
Running on latest ruff release, 0.3.7, on python 3.11
The text was updated successfully, but these errors were encountered:
Hello,
I am trying to use ruff to automatically fix issues with collections import that have moved to collections.abc in python 3.10+
I've found that ruff can only detect and fix the import about half the time.
Try with
ruff --select ALL example.py
In the top example, ruff finds the error and can fix it automatically.
In the bottom example, ruff doesn't find any error when it should have.
The code fails at runtime.
Running on latest ruff release, 0.3.7, on python 3.11
The text was updated successfully, but these errors were encountered: