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

Improved pyright's enforcement of keyword arguments passed within a `… #6405

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

erictraut
Copy link
Collaborator

…classstatement when the class has no custom metaclass orinit_subclassin its hierarchy. In this case, theobject.init_subclassmethod applies, and it accepts no additional keyword arguments. Also improved the error reporting forinit_subclass` in general. This addresses #6403.

…class` statement when the class has no custom metaclass or `__init_subclass__` in its hierarchy. In this case, the `object.__init_subclass__` method applies, and it accepts no additional keyword arguments. Also improved the error reporting for `__init_subclass__` in general. This addresses #6403.
Copy link
Contributor

github-actions bot commented Nov 9, 2023

Diff from mypy_primer, showing the effect of this PR on open source code:

steam.py (https://github.com/Gobot1234/steam.py)
+   /tmp/mypy_primer/projects/steam.py/steam/types/manifest.py:29:28 - error: No parameter named "total" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/types/manifest.py:29:7 - error: Incorrect keyword arguments for __init_subclass__ method (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/types/manifest.py:153:30 - error: No parameter named "total" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/types/manifest.py:153:7 - error: Incorrect keyword arguments for __init_subclass__ method (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/types/manifest.py:276:30 - error: No parameter named "total" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/types/manifest.py:276:7 - error: Incorrect keyword arguments for __init_subclass__ method (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/types/manifest.py:282:27 - error: No parameter named "total" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/types/manifest.py:282:7 - error: Incorrect keyword arguments for __init_subclass__ method (reportGeneralTypeIssues)
- 8413 errors, 22 warnings, 0 informations 
+ 8421 errors, 22 warnings, 0 informations 

dd-trace-py (https://github.com/DataDog/dd-trace-py): typechecking got 1.35x faster (95.6s -> 71.0s)
(Performance measurements are based on a single noisy sample)

@erictraut erictraut merged commit de7625f into main Nov 9, 2023
@erictraut erictraut deleted the issue6403 branch November 9, 2023 19:03
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