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

Fix overloaded static methods on instances #13482

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

ilevkivskyi
Copy link
Member

Fixes #7781

The fix is trivial. I guess this case was overlooked because someone thought static methods are all Decorators, well not always ;-)

@github-actions
Copy link
Contributor

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

rotki (https://github.com/rotki/rotki)
+ rotkehlchen/globaldb/handler.py:1345: error: Unused "type: ignore" comment
+ rotkehlchen/globaldb/handler.py:1358: error: "Dict[str, Any]" has no attribute "asset_type"
+ rotkehlchen/globaldb/handler.py:1360: error: "Dict[str, Any]" has no attribute "asset_type"
+ rotkehlchen/globaldb/handler.py:1365: error: "Dict[str, Any]" has no attribute "swapped_for"
+ rotkehlchen/globaldb/handler.py:1366: error: "Dict[str, Any]" has no attribute "name"
+ rotkehlchen/globaldb/handler.py:1367: error: "Dict[str, Any]" has no attribute "symbol"
+ rotkehlchen/globaldb/handler.py:1368: error: "Dict[str, Any]" has no attribute "started"
+ rotkehlchen/globaldb/handler.py:1370: error: "Dict[str, Any]" has no attribute "cryptocompare"
+ rotkehlchen/globaldb/handler.py:1371: error: "Dict[str, Any]" has no attribute "coingecko"
+ rotkehlchen/globaldb/handler.py:1372: error: "Dict[str, Any]" has no attribute "ethereum_address"
+ rotkehlchen/globaldb/handler.py:1373: error: "Dict[str, Any]" has no attribute "decimals"
+ rotkehlchen/globaldb/handler.py:1374: error: "Dict[str, Any]" has no attribute "protocol"
+ rotkehlchen/globaldb/handler.py:1378: error: "Dict[str, Any]" has no attribute "asset_type"
+ rotkehlchen/globaldb/handler.py:1380: error: "Dict[str, Any]" has no attribute "asset_type"
+ rotkehlchen/globaldb/handler.py:1385: error: "Dict[str, Any]" has no attribute "swapped_for"
+ rotkehlchen/globaldb/handler.py:1386: error: "Dict[str, Any]" has no attribute "forked"
+ rotkehlchen/globaldb/handler.py:1387: error: "Dict[str, Any]" has no attribute "name"
+ rotkehlchen/globaldb/handler.py:1388: error: "Dict[str, Any]" has no attribute "symbol"
+ rotkehlchen/globaldb/handler.py:1389: error: "Dict[str, Any]" has no attribute "asset_type"
+ rotkehlchen/globaldb/handler.py:1390: error: "Dict[str, Any]" has no attribute "started"
+ rotkehlchen/globaldb/handler.py:1393: error: "Dict[str, Any]" has no attribute "cryptocompare"
+ rotkehlchen/globaldb/handler.py:1394: error: "Dict[str, Any]" has no attribute "coingecko"
+ rotkehlchen/icons.py:155: error: Unused "type: ignore" comment
+ rotkehlchen/api/rest.py:1320: error: Unused "type: ignore" comment

@ilevkivskyi
Copy link
Member Author

The mypy_primer errors are correct. Previously the type was Any, but now an actual return type is used, but the type is incorrect.

@hauntsaninja hauntsaninja merged commit e981431 into python:master Aug 23, 2022
@ilevkivskyi ilevkivskyi deleted the fix-static-overload branch August 23, 2022 10:26
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.

Overloading staticmethods
2 participants