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

Changed behavior when converting a class to a callable. If the class … #6427

Merged
merged 1 commit into from
Nov 12, 2023

Conversation

erictraut
Copy link
Collaborator

…has no __init__ or __new__ method in its class hierarchy (other than those provided by object), pyright previously converted the constructor to a signature of (*args: Any, **kwargs: Any). It now converts it to a signature of () (i.e. no params) unless it's a type[T] or a protocol class. This addresses #6426.

…has no `__init__` or `__new__` method in its class hierarchy (other than those provided by `object`), pyright previously converted the constructor to a signature of `(*args: Any, **kwargs: Any)`. It now converts it to a signature of `()` (i.e. no params) unless it's a `type[T]` or a protocol class. This addresses #6426.
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@erictraut erictraut merged commit a88d49e into main Nov 12, 2023
11 checks passed
@erictraut erictraut deleted the issue6426 branch November 12, 2023 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant