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

Added check for the use of an ellipsis for a default argument value f… #6015

Merged
merged 2 commits into from
Sep 24, 2023

Conversation

erictraut
Copy link
Collaborator

…or a function that is not in a stub, not overloaded, and without a placeholder implementation. This addresses #5985.

…or a function that is not in a stub, not overloaded, and without a placeholder implementation. This addresses #5985.
@github-actions

This comment has been minimized.

@erictraut
Copy link
Collaborator Author

@Gobot1234, this change will require a modification to your code base. You're using ... in a manner that isn't legit.

BTW, while looking into the new errors, I ran across the comment "# I won't tell Eric if you won't. (This isn't part of PEP 696)". 😀

@github-actions
Copy link
Contributor

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

pydantic (https://github.com/samuelcolvin/pydantic)
+   /tmp/mypy_primer/projects/pydantic/pydantic/type_adapter.py:130:70 - error: Expression of type "ellipsis" cannot be assigned to parameter of type "ConfigDict | None"
+     Type "ellipsis" cannot be assigned to type "ConfigDict | None"
+       "ellipsis" is incompatible with "ConfigDict"
+       Type cannot be assigned to type "None" (reportGeneralTypeIssues)
- 49 errors, 0 warnings, 0 informations 
+ 50 errors, 0 warnings, 0 informations 

steam.py (https://github.com/Gobot1234/steam.py)
+   /tmp/mypy_primer/projects/steam.py/steam/chat.py:795:49 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/gateway.py:494:63 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/gateway.py:500:73 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/gateway.py:578:84 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(ProtoMsgsT@send_proto_and_wait) -> bool" in function "send_proto_and_wait"
+     Type "ellipsis" cannot be assigned to type "(ProtoMsgsT@send_proto_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/gateway.py:619:63 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/gateway.py:634:65 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/profile.py
+   /tmp/mypy_primer/projects/steam.py/steam/profile.py:145:21 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:496:58 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:527:58 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:547:64 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:573:21 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:627:51 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:646:61 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:661:61 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:674:58 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:685:80 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(ProtoMsgsT@send_proto_and_wait) -> bool" in function "send_proto_and_wait"
+     Type "ellipsis" cannot be assigned to type "(ProtoMsgsT@send_proto_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:694:54 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:705:66 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(ProtoMsgsT@send_proto_and_wait) -> bool" in function "send_proto_and_wait"
+     Type "ellipsis" cannot be assigned to type "(ProtoMsgsT@send_proto_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:714:64 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(ProtoMsgsT@send_proto_and_wait) -> bool" in function "send_proto_and_wait"
+     Type "ellipsis" cannot be assigned to type "(ProtoMsgsT@send_proto_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:725:61 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(ProtoMsgsT@send_proto_and_wait) -> bool" in function "send_proto_and_wait"
+     Type "ellipsis" cannot be assigned to type "(ProtoMsgsT@send_proto_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:738:53 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:751:57 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:758:56 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:771:67 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:794:21 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:809:47 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(ProtoMsgsT@send_proto_and_wait) -> bool" in function "send_proto_and_wait"
+     Type "ellipsis" cannot be assigned to type "(ProtoMsgsT@send_proto_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:814:50 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:819:50 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/steam.py/steam/state.py:838:73 - error: Argument of type "ellipsis" cannot be assigned to parameter "check" of type "(UnifiedMsgT@send_um_and_wait) -> bool" in function "send_um_and_wait"
+     Type "ellipsis" cannot be assigned to type "(UnifiedMsgT@send_um_and_wait) -> bool" (reportGeneralTypeIssues)

... (truncated 158 lines) ...

@erictraut erictraut merged commit 5b5b56a into main Sep 24, 2023
12 checks passed
@erictraut erictraut deleted the issue5985 branch September 24, 2023 05:06
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.

2 participants