KEMBAR78
Consider overlap between instances and callables by ilevkivskyi · Pull Request #17389 · python/mypy · GitHub
Skip to content

Conversation

ilevkivskyi
Copy link
Member

Fixes #8869

The fix seems straightforward.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

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

psycopg (https://github.com/psycopg/psycopg)
+ tests/test_cursor_server.py:27: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/test_cursor_server_async.py:28: error: Unused "type: ignore" comment  [unused-ignore]

steam.py (https://github.com/Gobot1234/steam.py)
+ steam/ext/commands/commands.py:553: error: Too many arguments for "object"  [call-arg]

antidote (https://github.com/Finistere/antidote)
- src/antidote/lib/lazy_ext/_lazy.py:171: error: Non-overlapping identity check (left operand type: "Literal[FunctionKind.VALUE]", right operand type: "Literal[FunctionKind.METHOD]")  [comparison-overlap]
- src/antidote/lib/lazy_ext/_lazy.py:174: error: Unused "type: ignore" comment  [unused-ignore]
- src/antidote/lib/lazy_ext/_lazy.py:178: error: Non-overlapping identity check (left operand type: "Literal[FunctionKind.VALUE]", right operand type: "Literal[FunctionKind.PROPERTY]")  [comparison-overlap]
- src/antidote/lib/lazy_ext/_lazy.py:181: error: Unused "type: ignore" comment  [unused-ignore]
- src/antidote/lib/lazy_ext/_lazy.py:185: error: Non-overlapping identity check (left operand type: "Literal[FunctionKind.VALUE]", right operand type: "Literal[FunctionKind.FUNCTION]")  [comparison-overlap]
+ src/antidote/lib/interface_ext/__init__.py:1289: error: Overloaded function signatures 1 and 5 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/__init__.py:1321: error: Overloaded function signatures 1 and 5 overlap with incompatible return types  [overload-overlap]
- tests/lib/interface/test_function.py:83: error: Unused "type: ignore" comment  [unused-ignore]
- tests/lib/interface/test_function.py:86: error: Unused "type: ignore" comment  [unused-ignore]
- tests/lib/interface/test_function.py:89: error: Unused "type: ignore" comment  [unused-ignore]
- tests/lib/interface/test_function.py:154: error: Unused "type: ignore" comment  [unused-ignore]
- tests/lib/interface/test_function.py:191: error: Unused "type: ignore" comment  [unused-ignore]
- tests/lib/interface/test_function.py:194: error: Unused "type: ignore" comment  [unused-ignore]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/ioloop_test.py:55: error: Unused "type: ignore" comment  [unused-ignore]
+ tornado/test/ioloop_test.py:56: error: Unused "type: ignore" comment  [unused-ignore]

operator (https://github.com/canonical/operator)
- ops/framework.py:799: error: Unused "type: ignore" comment  [unused-ignore]
- ops/framework.py:818: error: Unused "type: ignore" comment  [unused-ignore]

spark (https://github.com/apache/spark)
- python/pyspark/sql/worker/write_into_data_source.py:157: error: Unused "type: ignore" comment  [unused-ignore]
- python/pyspark/sql/worker/write_into_data_source.py:164: error: Unused "type: ignore" comment  [unused-ignore]
- python/pyspark/sql/worker/create_data_source.py:131: error: Unused "type: ignore" comment  [unused-ignore]
- python/pyspark/sql/worker/create_data_source.py:156: error: Unused "type: ignore" comment  [unused-ignore]
- python/pyspark/sql/worker/create_data_source.py:166: error: Unused "type: ignore" comment  [unused-ignore]
- python/pyspark/sql/worker/create_data_source.py:168: error: Unused "type: ignore" comment  [unused-ignore]

@ilevkivskyi
Copy link
Member Author

Most things in the mypy_primer are correct. The overload issues is annoying, I am actually going to re-design the whole overload overlap thing, PR incoming.

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.

MethodType incorrectly rejected as subtype of Callable

2 participants