Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ty] Skip shadowed submodule bindings during import analysis#26385

Merged
carljm merged 2 commits into
mainfrom
cjm/2438-skip-shadowed-submodule-binding
Jun 25, 2026
Merged

[ty] Skip shadowed submodule bindings during import analysis#26385
carljm merged 2 commits into
mainfrom
cjm/2438-skip-shadowed-submodule-binding

Conversation

@carljm

@carljm carljm commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Avoid registering an import from submodule definition when the imported name is immediately shadowed by another binding in the same statement.

Closes astral-sh/ty#2438

Testing

Added mdtest.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label Jun 25, 2026
@astral-sh-bot astral-sh-bot Bot changed the title Skip shadowed submodule bindings during import analysis [ty] Skip shadowed submodule bindings during import analysis Jun 25, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 94.47%. The percentage of expected errors that received a diagnostic held steady at 89.19%. The number of fully passing files held steady at 95/134.

@astral-sh-bot

astral-sh-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

Lint rule Added Removed Changed
call-non-callable 0 1 0
Total 0 1 0

Raw diff:

strawberry (https://github.com/strawberry-graphql/strawberry)
- strawberry/cli/__init__.py:15:9 error[call-non-callable] Object of type `<module 'strawberry.cli.app'>` is not callable

Full report with detailed diff (timing results)

@carljm carljm marked this pull request as ready for review June 25, 2026 19:42
@carljm carljm requested review from a team as code owners June 25, 2026 19:42
@astral-sh-bot astral-sh-bot Bot requested a review from dhruvmanila June 25, 2026 19:42
@carljm

carljm commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Going to go ahead and merge this to reduce review load, as it's quite simple and I'm confident it's correct, and it has clearly positive impacts. Happy to address post-merge review comments from anyone!

@carljm carljm merged commit 43b5e8b into main Jun 25, 2026
63 checks passed
@carljm carljm deleted the cjm/2438-skip-shadowed-submodule-binding branch June 25, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A global try-except block preceding a shadowing import causes incorrect type inference (Module | Object) in local scope

1 participant