Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[red-knot] Document 'public type of undeclared symbols' behavior #16096

Merged
merged 8 commits into from
Feb 12, 2025

Conversation

sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Feb 11, 2025

Summary

After I was asked twice within the same day, I thought it would be a good idea to write some user facing documentation that explains our reasoning behind inferring Unknown | T_inferred for public uses of undeclared symbols. This is a major deviation from the behavior of other type checkers and it seems like a good practice to defend our choice like this. Please let me know if I missed something or if you see a chance to explain this more clearly.

Rendered version

@sharkdp sharkdp added the red-knot Multi-file analysis & type inference label Feb 11, 2025
@sharkdp sharkdp force-pushed the david/public-type-undeclared branch from 57b4851 to 68e979b Compare February 11, 2025 11:32
@sharkdp sharkdp force-pushed the david/public-type-undeclared branch from 68e979b to 3136623 Compare February 11, 2025 11:33
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this is great

Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is excellent, thanks for writing it up!

Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Copy link
Member

@dhruvmanila dhruvmanila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is excellent, thank you!

@sharkdp sharkdp merged commit 366ae1f into main Feb 12, 2025
21 checks passed
@sharkdp sharkdp deleted the david/public-type-undeclared branch February 12, 2025 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants