mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-25 09:28:14 +00:00
## Summary Add support for `async for` loops and async iterables. part of https://github.com/astral-sh/ty/issues/151 ## Ecosystem impact ```diff - boostedblob/listing.py:445:54: warning[unused-ignore-comment] Unused blanket `type: ignore` directive ``` This is correct. We now find a true positive in the `# type: ignore`'d code. All of the other ecosystem hits are of the type ```diff trio (https://github.com/python-trio/trio) + src/trio/_core/_tests/test_guest_mode.py:532:24: error[not-iterable] Object of type `MemorySendChannel[int] | MemoryReceiveChannel[int]` may not be iterable ``` The message is correct, because only `MemoryReceiveChannel` has an `__aiter__` method, but `MemorySendChannel` does not. What's not correct is our inferred type here. It should be `MemoryReceiveChannel[int]`, not the union of the two. This is due to missing unpacking support for tuple subclasses, which @AlexWaygood is working on. I don't think this should block merging this PR, because those wrong types are already there, without this PR. ## Test Plan New Markdown tests and snapshot tests for diagnostics. |
||
|---|---|---|
| .. | ||
| attribute_assignment.md | ||
| invalid_argument_type.md | ||
| no_matching_overload.md | ||
| semantic_syntax_errors.md | ||
| shadowing.md | ||
| single_matching_overload.md | ||
| union_call.md | ||
| unpacking.md | ||
| unresolved_import.md | ||
| unresolved_reference.md | ||
| unsupported_bool_conversion.md | ||
| version_related_syntax_errors.md | ||