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

Add one more type-checking pass #18717

Merged
merged 2 commits into from
Feb 21, 2025
Merged

Conversation

ilevkivskyi
Copy link
Member

This helps in rare cases, see discussion in #18674

This comment has been minimized.

Copy link
Contributor

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

steam.py (https://github.com/Gobot1234/steam.py)
- steam/guard.py:126: error: Cannot determine type of "http"  [has-type]
- steam/models.py:221: error: Cannot determine type of "http"  [has-type]
- steam/models.py:289: error: Cannot determine type of "handled_wallet"  [has-type]
- steam/models.py:290: error: Cannot determine type of "http"  [has-type]
- steam/models.py:296: error: Cannot determine type of "handled_wallet"  [has-type]
- steam/models.py:408: error: Cannot determine type of "http"  [has-type]
- steam/badge.py:162: error: Cannot determine type of "http"  [has-type]
- steam/http.py:99: error: Cannot determine type of "login_complete"  [has-type]
- steam/http.py:195: error: Cannot determine type of "login_complete"  [has-type]
- steam/app.py:340: error: Cannot determine type of "http"  [has-type]
- steam/app.py:676: error: Cannot determine type of "http"  [has-type]
- steam/app.py:697: error: Cannot determine type of "http"  [has-type]
- steam/app.py:736: error: Cannot determine type of "http"  [has-type]
- steam/app.py:830: error: Cannot determine type of "http"  [has-type]
- steam/app.py:831: error: Cannot determine type of "http"  [has-type]
- steam/app.py:883: error: Cannot determine type of "http"  [has-type]
- steam/app.py:936: error: Cannot determine type of "http"  [has-type]
- steam/app.py:1114: error: Cannot determine type of "http"  [has-type]
- steam/app.py:1149: error: Cannot determine type of "http"  [has-type]
- steam/trade.py:155: error: Cannot determine type of "http"  [has-type]
- steam/trade.py:594: error: Cannot determine type of "http"  [has-type]
- steam/trade.py:611: error: Cannot determine type of "http"  [has-type]
- steam/trade.py:624: error: Cannot determine type of "http"  [has-type]
- steam/trade.py:638: error: Cannot determine type of "http"  [has-type]
- steam/trade.py:645: error: Missing keys ("instanceid", "classid", "market_hash_name", "assetid", "amount", "appid", "contextid", "missing", "rollback_new_assetid", "rollback_new_contextid") for TypedDict "TradeOfferReceiptItem"  [typeddict-item]
- steam/trade.py:650: error: Missing keys ("instanceid", "classid", "market_hash_name", "assetid", "amount", "appid", "contextid", "missing", "rollback_new_assetid", "rollback_new_contextid") for TypedDict "TradeOfferReceiptItem"  [typeddict-item]
- steam/reaction.py:111: error: Cannot determine type of "http"  [has-type]
- steam/reaction.py:279: error: Cannot determine type of "http"  [has-type]
- steam/reaction.py:318: error: Cannot determine type of "http"  [has-type]
- steam/package.py:121: error: Cannot determine type of "http"  [has-type]
- steam/package.py:408: error: Cannot determine type of "http"  [has-type]
- steam/manifest.py:666: error: Cannot determine type of "http"  [has-type]
- steam/abc.py:332: error: Cannot determine type of "http"  [has-type]
- steam/abc.py:336: error: Cannot determine type of "http"  [has-type]
- steam/abc.py:387: error: Cannot determine type of "http"  [has-type]
- steam/abc.py:435: error: Cannot determine type of "http"  [has-type]
- steam/abc.py:447: error: Cannot determine type of "http"  [has-type]
- steam/abc.py:463: error: Cannot determine type of "http"  [has-type]
- steam/abc.py:495: error: Cannot determine type of "http"  [has-type]
- steam/abc.py:516: error: Cannot determine type of "http"  [has-type]
- steam/abc.py:520: error: Cannot determine type of "http"  [has-type]
- steam/abc.py:533: error: Cannot determine type of "http"  [has-type]
- steam/abc.py:543: error: Cannot determine type of "http"  [has-type]
- steam/abc.py:657: error: Cannot determine type of "http"  [has-type]
- steam/user.py:158: error: Cannot determine type of "http"  [has-type]
- steam/user.py:376: error: Cannot determine type of "http"  [has-type]
- steam/user.py:380: error: Cannot determine type of "http"  [has-type]
- steam/user.py:479: error: Cannot determine type of "http"  [has-type]
- steam/user.py:481: error: Cannot determine type of "http"  [has-type]
- steam/published_file.py:372: error: Cannot determine type of "http"  [has-type]
- steam/published_file.py:504: error: Cannot determine type of "http"  [has-type]
- steam/post.py:44: error: Cannot determine type of "http"  [has-type]
- steam/post.py:48: error: Cannot determine type of "http"  [has-type]
+ steam/post.py:44: error: Argument 2 to "vote_on_user_post" of "HTTPClient" has incompatible type "PostID | _ReadOnlyProto[PostID]"; expected "PostID"  [arg-type]
+ steam/post.py:48: error: Argument 2 to "vote_on_user_post" of "HTTPClient" has incompatible type "PostID | _ReadOnlyProto[PostID]"; expected "PostID"  [arg-type]
- steam/event.py:258: error: Cannot determine type of "http"  [has-type]
- steam/event.py:280: error: Cannot determine type of "http"  [has-type]
- steam/event.py:338: error: Cannot determine type of "http"  [has-type]
- steam/event.py:346: error: Cannot determine type of "http"  [has-type]
- steam/review.py:213: error: Cannot determine type of "http"  [has-type]
- steam/review.py:217: error: Cannot determine type of "http"  [has-type]
- steam/review.py:221: error: Cannot determine type of "http"  [has-type]
+ steam/review.py:213: error: Argument 1 to "mark_review_as_helpful" of "HTTPClient" has incompatible type "int | _ReadOnlyProto[int]"; expected "int"  [arg-type]
+ steam/review.py:217: error: Argument 1 to "mark_review_as_helpful" of "HTTPClient" has incompatible type "int | _ReadOnlyProto[int]"; expected "int"  [arg-type]
+ steam/review.py:221: error: Argument 1 to "mark_review_as_funny" of "HTTPClient" has incompatible type "int | _ReadOnlyProto[int]"; expected "int"  [arg-type]
- steam/review.py:266: error: Cannot determine type of "http"  [has-type]
- steam/gateway.py:117: error: Cannot determine type of "http"  [has-type]
- steam/gateway.py:121: error: Cannot determine type of "http"  [has-type]
- steam/gateway.py:135: error: Cannot determine type of "http"  [has-type]
- steam/gateway.py:214: error: Cannot determine type of "thread_id"  [has-type]
- steam/gateway.py:414: error: Cannot determine type of "intents"  [has-type]
- steam/gateway.py:415: error: Cannot determine type of "handled_chat_groups"  [has-type]
- steam/gateway.py:416: error: Cannot determine type of "intents"  [has-type]
- steam/gateway.py:418: error: Cannot determine type of "handled_friends"  [has-type]
- steam/gateway.py:419: error: Cannot determine type of "handled_emoticons"  [has-type]
- steam/gateway.py:420: error: Cannot determine type of "handled_licenses"  [has-type]
- steam/gateway.py:421: error: Cannot determine type of "handled_wallet"  [has-type]
- steam/gateway.py:489: error: Cannot determine type of "login_complete"  [has-type]
- steam/gateway.py:692: error: Cannot determine type of "login_complete"  [has-type]
- steam/friend.py:69: error: Cannot determine type of "http"  [has-type]
- steam/chat.py:385: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:123: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:136: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:154: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:159: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:163: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:176: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:189: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:257: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:301: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:373: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:565: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:569: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:574: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:637: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:646: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:710: error: Cannot determine type of "http"  [has-type]
- steam/clan.py:718: error: Cannot determine type of "http"  [has-type]
- steam/bundle.py:81: error: Cannot determine type of "http"  [has-type]
- steam/bundle.py:97: error: Cannot determine type of "http"  [has-type]
- steam/state.py:175: error: Cannot determine type of "intents"  [has-type]
- steam/ext/commands/converters.py:222: error: Cannot determine type of "special_converters"  [has-type]

pydantic (https://github.com/pydantic/pydantic)
- pydantic/_internal/_fields.py:228: error: Cannot determine type of "_complete"  [has-type]
- pydantic/_internal/_fields.py:249: error: Cannot determine type of "_complete"  [has-type]
- pydantic/_internal/_fields.py:275: error: Cannot determine type of "_complete"  [has-type]
- pydantic/_internal/_fields.py:332: error: Cannot determine type of "_complete"  [has-type]

spark (https://github.com/apache/spark)
+ python/pyspark/util.py:546: error: Unused "type: ignore" comment  [unused-ignore]
+ python/pyspark/util.py:564: error: Unused "type: ignore" comment  [unused-ignore]

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/math.py:17: error: Unused "type: ignore" comment  [unused-ignore]

freqtrade (https://github.com/freqtrade/freqtrade)

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/_trace/tracer.py:489: error: Unused "type: ignore" comment  [unused-ignore]
+ ddtrace/_trace/tracer.py:490: error: Unused "type: ignore" comment  [unused-ignore]
+ ddtrace/_trace/tracer.py:491: error: Unused "type: ignore" comment  [unused-ignore]

trio (https://github.com/python-trio/trio)
+ src/trio/_dtls.py:790: error: Unused "type: ignore" comment  [unused-ignore]

@ilevkivskyi ilevkivskyi merged commit 2d3df02 into python:master Feb 21, 2025
18 checks passed
@ilevkivskyi ilevkivskyi deleted the defer-more branch February 21, 2025 22:06
x612skm pushed a commit to x612skm/mypy-dev that referenced this pull request Feb 24, 2025
This helps in rare cases, see discussion in
python#18674
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