Skip to content

Conversation

BvB93
Copy link
Contributor

@BvB93 BvB93 commented Jul 8, 2021

Follow up on #5694.

This PR replaces (where applicable) all remaining cases of int-based annotations with SupportsIndex.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2021

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

werkzeug (https://github.com/pallets/werkzeug.git)
+ src/werkzeug/datastructures.pyi:41: error: Argument 1 of "__imul__" is incompatible with supertype "list"; supertype defines the argument type as "SupportsIndex"
+ src/werkzeug/datastructures.pyi:41: note: This violates the Liskov substitution principle
+ src/werkzeug/datastructures.pyi:41: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
+ src/werkzeug/datastructures.pyi:41: error: Argument 1 of "__imul__" is incompatible with "__mul__" of supertype "list"; supertype defines the argument type as "SupportsIndex"
+ src/werkzeug/datastructures.pyi:41: error: Signatures of "__imul__" and "__mul__" are incompatible
+ src/werkzeug/datastructures.pyi:48: error: Argument 1 of "insert" is incompatible with supertype "list"; supertype defines the argument type as "SupportsIndex"
+ src/werkzeug/datastructures.pyi:48: note: This violates the Liskov substitution principle
+ src/werkzeug/datastructures.pyi:48: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
+ src/werkzeug/datastructures.pyi:49: error: Argument 1 of "pop" is incompatible with supertype "list"; supertype defines the argument type as "SupportsIndex"
+ src/werkzeug/datastructures.pyi:49: note: This violates the Liskov substitution principle
+ src/werkzeug/datastructures.pyi:49: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
- tests/test_wrappers.py:370: error: Function is missing a return type annotation
- tests/test_wrappers.py:388: error: Function is missing a return type annotation
- tests/test_wrappers.py:388: note: Use "-> None" if function does not return a value
- tests/test_wrappers.py:423: error: Function is missing a return type annotation
- tests/test_wrappers.py:423: note: Use "-> None" if function does not return a value
- tests/test_wrappers.py:648: error: Function is missing a type annotation
- tests/test_wrappers.py:682: error: Function is missing a return type annotation
- tests/test_wrappers.py:682: note: Use "-> None" if function does not return a value
- tests/test_wrappers.py:691: error: Function is missing a return type annotation
- tests/test_wrappers.py:693: error: Function is missing a type annotation
- tests/test_wrappers.py:696: error: Function is missing a type annotation
- tests/test_wrappers.py:699: error: Function is missing a type annotation
- tests/test_wrappers.py:710: error: Function is missing a return type annotation
- tests/test_wrappers.py:710: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)
+ tests/test_wrappers.py:370: note: (Skipping most remaining errors due to unresolved imports or missing stubs; fix these first)

@Akuli Akuli merged commit 5e23e2c into python:master Jul 9, 2021
@BvB93 BvB93 deleted the index branch July 9, 2021 10:08
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