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

Skip to content

[ty] Respect @no_type_check in function validation#25994

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/respect-no-type-check-function-validation
Jun 14, 2026
Merged

[ty] Respect @no_type_check in function validation#25994
charliermarsh merged 1 commit into
mainfrom
charlie/respect-no-type-check-function-validation

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

@no_type_check promises to suppress errors in a function declaration and body, but diagnostics emitted during post-inference function validation were not suppressed:

from typing import no_type_check

@no_type_check
def positional(x: int, __y: str): ...

Post-inference validation runs from the function's enclosing inference context, so the decorated function is not visible through the usual ancestor-scope suppression check. This returns before running those declaration checks when the function itself has a known @no_type_check decorator.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label Jun 14, 2026
@charliermarsh charliermarsh marked this pull request as ready for review June 14, 2026 19:43
@astral-sh-bot

astral-sh-bot Bot commented Jun 14, 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.36%. The percentage of expected errors that received a diagnostic held steady at 88.82%. The number of fully passing files held steady at 93/134.

@astral-sh-bot

astral-sh-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.

Full report with detailed diff (timing results)

@charliermarsh charliermarsh marked this pull request as ready for review June 14, 2026 20:19
@charliermarsh charliermarsh merged commit d563277 into main Jun 14, 2026
59 checks passed
@charliermarsh charliermarsh deleted the charlie/respect-no-type-check-function-validation branch June 14, 2026 20:19
@charliermarsh

Copy link
Copy Markdown
Member Author

Merging this directly; we already respect this in function bodies, this looks like an oversight.

@AlexWaygood

Copy link
Copy Markdown
Member

Nice, thanks, definitely an oversight

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.

3 participants