[ty] Emit more specific diagnostics for "possibly unbound" errors from context manager dunder methods invoked on a union. by lerebear · Pull Request #24662 · astral-sh/ruff (original) (raw)

@lerebear self-assigned this

Apr 15, 2026

@lerebear

@lerebear lerebear marked this pull request as ready for review

April 16, 2026 05:53

charliermarsh

charliermarsh

charliermarsh

@lerebear

@lerebear

charliermarsh

charliermarsh

charliermarsh

@lerebear

@lerebear lerebear deleted the lerebear/push-tuskvpoxpzyx branch

April 20, 2026 18:40

lerebear added a commit that referenced this pull request

Apr 24, 2026

@lerebear

…nd errors from implicit dunder calls against unions. (#24676)

Summary

Building on #24662, and to resolve astral-sh/ty#940, this adds more "info" sub-diagnostics to possibly unbound method error messages that occur when a dunder is called implicitly against a union type. The implicit dunder calls covered here are __iter__, __await__ and __mro_entries__.

Test Plan

Please see new/updated mdtests and related snapshots.

This was referenced

Apr 27, 2026

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})