Skip to content

equal literal#3

Draft
hauntsaninja wants to merge 1 commit intomasterfrom
equal-literal
Draft

equal literal#3
hauntsaninja wants to merge 1 commit intomasterfrom
equal-literal

Conversation

@hauntsaninja
Copy link
Copy Markdown
Owner

No description provided.

@github-actions

This comment has been minimized.

@hauntsaninja hauntsaninja changed the title tmp equal literal Nov 14, 2024
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

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

optuna (https://github.com/optuna/optuna)
+ tests/samplers_tests/test_qmc.py:115: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/samplers_tests/test_qmc.py:145: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/samplers_tests/test_qmc.py:166: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/samplers_tests/test_nsgaiii.py:238: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/samplers_tests/test_nsgaii.py:716: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/samplers_tests/test_nsgaii.py:754: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/trial_tests/test_trial.py:263: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/study_tests/test_study.py:1246: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[3]")  [comparison-overlap]
+ tests/study_tests/test_study.py:1897: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/study_tests/test_study.py:1921: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]

spark (https://github.com/apache/spark)
+ python/pyspark/errors/exceptions/tblib.py:209: error: Argument 1 to "dict" has incompatible type "dict[Literal['__file__', '__name__'], Any]"; expected "SupportsKeysAndGetItem[str, Any]"  [arg-type]

psycopg (https://github.com/psycopg/psycopg)
+ tests/test_capabilities.py:99: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/pool/test_pool_null_async.py:144: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/pool/test_pool_null_async.py:194: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/pool/test_pool_async.py:198: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/pool/test_pool_async.py:222: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/pool/test_pool_async.py:680: error: Non-overlapping equality check (left operand type: "Literal[4]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/pool/test_pool_null.py:145: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/pool/test_pool_null.py:195: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/pool/test_pool.py:198: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/pool/test_pool.py:222: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ tests/pool/test_pool.py:679: error: Non-overlapping equality check (left operand type: "Literal[4]", right operand type: "Literal[2]")  [comparison-overlap]

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/cli/deploy/_actions.py:192: error: No overload variant of "__setitem__" of "list" matches argument types "str", "list[dict[str, dict[str, Any]]]"  [call-overload]
- src/prefect/cli/deploy/_actions.py:192: note: Possible overload variants:
- src/prefect/cli/deploy/_actions.py:192: note:     def __setitem__(self, SupportsIndex, dict[str, Any], /) -> None
- src/prefect/cli/deploy/_actions.py:192: note:     def __setitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], Iterable[dict[str, Any]], /) -> None
- src/prefect/cli/deploy/_actions.py:200: error: No overload variant of "__setitem__" of "list" matches argument types "str", "list[dict[str, dict[str, Any]]]"  [call-overload]
- src/prefect/cli/deploy/_actions.py:200: note: Possible overload variants:
- src/prefect/cli/deploy/_actions.py:200: note:     def __setitem__(self, SupportsIndex, dict[str, Any], /) -> None
- src/prefect/cli/deploy/_actions.py:200: note:     def __setitem__(self, slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], Iterable[dict[str, Any]], /) -> None

PyGithub (https://github.com/PyGithub/PyGithub)
+ github/MainClass.py:691: error: Incompatible types in assignment (expression has type "Literal['asc', 'desc']", target has type "Literal['stars', 'forks', 'updated']")  [assignment]
+ github/MainClass.py:700: error: Incompatible types in assignment (expression has type "str", target has type "Literal['stars', 'forks', 'updated']")  [assignment]
+ github/MainClass.py:732: error: Incompatible types in assignment (expression has type "Literal['asc', 'desc']", target has type "Literal['followers', 'repositories', 'joined']")  [assignment]
+ github/MainClass.py:741: error: Incompatible types in assignment (expression has type "str", target has type "Literal['followers', 'repositories', 'joined']")  [assignment]
+ github/MainClass.py:773: error: Incompatible types in assignment (expression has type "Literal['asc', 'desc']", target has type "Literal['comments', 'created', 'updated']")  [assignment]
+ github/MainClass.py:782: error: Incompatible types in assignment (expression has type "str", target has type "Literal['comments', 'created', 'updated']")  [assignment]
+ github/MainClass.py:811: error: Incompatible types in assignment (expression has type "Literal['asc', 'desc']", target has type "Literal['indexed']")  [assignment]
+ github/MainClass.py:820: error: Incompatible types in assignment (expression has type "str", target has type "Literal['indexed']")  [assignment]
+ github/MainClass.py:855: error: Incompatible types in assignment (expression has type "Literal['asc', 'desc']", target has type "Literal['author-date', 'committer-date']")  [assignment]
+ github/MainClass.py:864: error: Incompatible types in assignment (expression has type "str", target has type "Literal['author-date', 'committer-date']")  [assignment]

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/helpers.py:296:12: error: Incompatible return value type (got "dict[Literal['http', 'https', 'ws', 'wss'], ProxyInfo]", expected "dict[str, ProxyInfo]")  [return-value]
+ aiohttp/helpers.py:296:12: note: Perhaps you need a type annotation for "ret"? Suggestion: "dict[str, ProxyInfo]"

starlette (https://github.com/encode/starlette)
+ tests/test_datastructures.py:317: error: Non-overlapping equality check (left operand type: "Literal[4]", right operand type: "Literal[19]")  [comparison-overlap]
+ tests/test_datastructures.py:350: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[4]")  [comparison-overlap]
+ tests/test_testclient.py:156: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[3]")  [comparison-overlap]
+ tests/test_responses.py:126: error: Non-overlapping equality check (left operand type: "Literal['']", right operand type: "Literal['6, 7, 8, 9']")  [comparison-overlap]
+ tests/test_responses.py:249: error: Non-overlapping equality check (left operand type: "Literal['']", right operand type: "Literal['6, 7, 8, 9']")  [comparison-overlap]
+ tests/test_applications.py:504: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]

zulip (https://github.com/zulip/zulip)
+ zerver/actions/message_flags.py:439: error: Incompatible types in assignment (expression has type "dict[str, MessageDetailsDict]", target has type "Literal['add', 'remove'] | bool | list[int] | str")  [assignment]

operator (https://github.com/canonical/operator)
- ops/pebble.py:1171: error: TypedDict key must be a string literal; expected one of ("command", "service-context", "environment", "user-id", "user", ...)  [literal-required]
- ops/pebble.py:1189: error: TypedDict key must be a string literal; expected one of ("url", "headers")  [literal-required]
+ ops/pebble.py:3509: error: Redundant cast to "Literal['response', 'files']"  [redundant-cast]

core (https://github.com/home-assistant/core)
+ homeassistant/components/awair/config_flow.py:225: error: Argument "errors" to "async_show_form" of "ConfigFlow" has incompatible type "dict[str, Literal['invalid_access_token']]"; expected "dict[str, str] | None"  [arg-type]
+ homeassistant/components/awair/config_flow.py:225: note: "dict" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
+ homeassistant/components/awair/config_flow.py:225: note: Consider using "Mapping" instead, which is covariant in the value type

aioredis (https://github.com/aio-libs/aioredis)
+ aioredis/client.py:1810: error: Argument 1 to "append" of "list" has incompatible type "int"; expected "Literal[0, 1] | bytes | str | memoryview[int]"  [arg-type]
+ aioredis/client.py:1812: error: Argument 1 to "append" of "list" has incompatible type "int"; expected "Literal[0, 1] | bytes | str | memoryview[int]"  [arg-type]

pytest (https://github.com/pytest-dev/pytest)
+ testing/test_monkeypatch.py:41: error: Non-overlapping equality check (left operand type: "Literal[2]", right operand type: "Literal[3]")  [comparison-overlap]
+ testing/test_monkeypatch.py:42: error: Statement is unreachable  [unreachable]
+ testing/test_monkeypatch.py:50: error: Unused "type: ignore" comment  [unused-ignore]
+ testing/test_monkeypatch.py:115: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[5]")  [comparison-overlap]
+ testing/test_monkeypatch.py:116: error: Statement is unreachable  [unreachable]
+ testing/test_monkeypatch.py:129: error: Non-overlapping equality check (left operand type: "Literal[2]", right operand type: "Literal[3]")  [comparison-overlap]
+ testing/test_monkeypatch.py:130: error: Statement is unreachable  [unreachable]
+ testing/test_monkeypatch.py:429: error: Non-overlapping equality check (left operand type: "Literal[2]", right operand type: "Literal[1]")  [comparison-overlap]
+ testing/test_doctest.py:1615: error: Statement is unreachable  [unreachable]
+ testing/test_doctest.py:1619: error: Unused "type: ignore" comment  [unused-ignore]
+ testing/test_doctest.py:1620: error: Statement is unreachable  [unreachable]
+ testing/test_compat.py:138: error: Non-overlapping equality check (left operand type: "Literal[0]", right operand type: "Literal[1]")  [comparison-overlap]
+ testing/test_compat.py:139: error: Statement is unreachable  [unreachable]
+ testing/logging/test_fixture.py:177: error: Non-overlapping equality check (left operand type: "Literal[50]", right operand type: "Literal[20]")  [comparison-overlap]
+ testing/logging/test_fixture.py:179: error: Statement is unreachable  [unreachable]
+ testing/logging/test_fixture.py:183: error: Statement is unreachable  [unreachable]
+ testing/code/test_excinfo.py:1059: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[3]")  [comparison-overlap]

mitmproxy (https://github.com/mitmproxy/mitmproxy)
+ mitmproxy/net/server_spec.py:85: error: Unused "type: ignore" comment  [unused-ignore]

steam.py (https://github.com/Gobot1234/steam.py)
- steam/ext/csgo/state.py:180: error: Argument "slot" to "Sticker" has incompatible type "int | None"; expected "Literal[0, 1, 2, 3, 4, 5] | None"  [arg-type]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/pytables.py:4841: error: Item "Index" of "ndarray[tuple[Any, ...], dtype[Any]] | Index" has no attribute "reshape"  [union-attr]
+ pandas/io/parsers/arrow_parser_wrapper.py:101: error: Invalid index type "Literal['invalid_row_handler']" for "dict[Literal['delimiter', 'quote_char', 'escape_char', 'ignore_empty_lines'], Any]"; expected type "Literal['delimiter', 'quote_char', 'escape_char', 'ignore_empty_lines']"  [index]
+ pandas/io/parsers/arrow_parser_wrapper.py:103: error: Invalid index type "Literal['invalid_row_handler']" for "dict[Literal['delimiter', 'quote_char', 'escape_char', 'ignore_empty_lines'], Any]"; expected type "Literal['delimiter', 'quote_char', 'escape_char', 'ignore_empty_lines']"  [index]
+ pandas/io/parsers/arrow_parser_wrapper.py:117: error: Invalid index type "Literal['invalid_row_handler']" for "dict[Literal['delimiter', 'quote_char', 'escape_char', 'ignore_empty_lines'], Any]"; expected type "Literal['delimiter', 'quote_char', 'escape_char', 'ignore_empty_lines']"  [index]
+ pandas/io/parsers/arrow_parser_wrapper.py:119: error: Invalid index type "Literal['invalid_row_handler']" for "dict[Literal['delimiter', 'quote_char', 'escape_char', 'ignore_empty_lines'], Any]"; expected type "Literal['delimiter', 'quote_char', 'escape_char', 'ignore_empty_lines']"  [index]
+ pandas/io/parsers/arrow_parser_wrapper.py:135: error: Invalid index type "Literal['strings_can_be_null']" for "dict[Literal['include_columns', 'null_values', 'true_values', 'false_values', 'decimal_point', 'timestamp_parsers'], Any]"; expected type "Literal['include_columns', 'null_values', 'true_values', 'false_values', 'decimal_point', 'timestamp_parsers']"  [index]
+ pandas/io/formats/format.py:181: error: Incompatible types in assignment (expression has type "int", variable has type "Literal[1]")  [assignment]

discord.py (https://github.com/Rapptz/discord.py)
- discord/mentions.py:126: error: Item "bool" of "bool | Sequence[Snowflake]" has no attribute "__iter__" (not iterable)  [union-attr]
- discord/mentions.py:131: error: Item "bool" of "bool | Sequence[Snowflake]" has no attribute "__iter__" (not iterable)  [union-attr]
- discord/mentions.py:134: error: Incompatible types in assignment (expression has type "bool", target has type "list[Any | int]")  [assignment]
+ discord/mentions.py:134: error: Incompatible types in assignment (expression has type "bool", target has type "list[int]")  [assignment]
- discord/mentions.py:136: error: Incompatible types in assignment (expression has type "list[str]", target has type "list[Any | int]")  [assignment]
+ discord/mentions.py:136: error: Incompatible types in assignment (expression has type "list[str]", target has type "list[int]")  [assignment]

werkzeug (https://github.com/pallets/werkzeug)
+ tests/test_wrappers.py:732: error: Non-overlapping equality check (left operand type: "Literal['text/html; charset=utf-8']", right operand type: "Literal['text/html; x-foo=yep']")  [comparison-overlap]
+ tests/test_wrappers.py:1086: error: Non-overlapping equality check (left operand type: "Literal["default-src 'self'"]", right operand type: "Literal["default-src 'self'; script-src 'self' palletsprojects.com"]")  [comparison-overlap]
- tests/test_utils.py:84: error: Function is missing a return type annotation  [no-untyped-def]
- tests/test_utils.py:94: error: Non-overlapping equality check (left operand type: "Callable[[], Any]", right operand type: "Literal[42]")  [comparison-overlap]
+ tests/test_utils.py:132: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
- tests/test_test.py:150: error: Incompatible types in assignment (expression has type "int", target has type "str")  [assignment]
+ tests/test_test.py:258: error: Non-overlapping equality check (left operand type: "Literal['http://example.com/bar/']", right operand type: "Literal['http://localhost/bar/']")  [comparison-overlap]

black (https://github.com/psf/black)
+ src/blib2to3/pgen2/pgen.py:287:13: error: Statement is unreachable  [unreachable]

pyodide (https://github.com/pyodide/pyodide)
+ pyodide-build/pyodide_build/pywasmcross.py:344: error: Argument 1 to "append" of "list" has incompatible type "str"; expected "Literal['Symbol {']"  [arg-type]
+ pyodide-build/pyodide_build/tests/recipe/test_bash_runner.py:28: error: Non-overlapping equality check (left operand type: "Literal['2']", right operand type: "Literal['7']")  [comparison-overlap]

jinja (https://github.com/pallets/jinja)
+ src/jinja2/parser.py:394: error: Non-overlapping equality check (left operand type: "Literal['name']", right operand type: "Literal['comma']")  [comparison-overlap]
+ src/jinja2/ext.py:481: error: Non-overlapping equality check (left operand type: "Literal['block_begin']", right operand type: "Literal['name']")  [comparison-overlap]

rotki (https://github.com/rotki/rotki)
+ rotkehlchen/chain/ethereum/modules/octant/decoder.py:82: error: Statement is unreachable  [unreachable]
+ rotkehlchen/tests/unit/test_tasks_manager.py:1240: error: Statement is unreachable  [unreachable]
+ rotkehlchen/tests/api/blockchain/test_base.py:325: error: Statement is unreachable  [unreachable]
+ rotkehlchen/tests/api/test_exchanges.py:700: error: Statement is unreachable  [unreachable]
+ rotkehlchen/tests/api/test_exchanges.py:825: error: Statement is unreachable  [unreachable]

paroxython (https://github.com/laowantong/paroxython)
+ paroxython/recommend_programs.py:169: error: Argument 2 to "parse_data" of "Recommendations" has incompatible type "Literal['include', 'exclude', 'impart', 'hide']"; expected "Operation"  [arg-type]
+ paroxython/recommend_programs.py:178: error: Argument 2 has incompatible type "Literal['include', 'exclude', 'impart', 'hide']"; expected "Operation"  [arg-type]
+ paroxython/recommend_programs.py:182: error: Argument 1 to "append" of "list" has incompatible type "tuple[int, Literal['include', 'exclude', 'impart', 'hide'], list[ProgramPath]]"; expected "tuple[int, Operation, list[ProgramPath]]"  [arg-type]

static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/interface.py:598: error: Incompatible types in assignment (expression has type "str", variable has type "Literal['values']")  [assignment]
+ static_frame/core/interface.py:1522: error: Incompatible types in assignment (expression has type "str", variable has type "Literal['values']")  [assignment]
+ static_frame/core/interface.py:1543: error: Statement is unreachable  [unreachable]
+ static_frame/core/interface.py:1545: error: Statement is unreachable  [unreachable]
+ static_frame/core/interface.py:1547: error: Statement is unreachable  [unreachable]
+ static_frame/core/interface.py:1592: error: Statement is unreachable  [unreachable]
+ static_frame/core/interface.py:1597: error: Statement is unreachable  [unreachable]
+ static_frame/core/interface.py:1602: error: Statement is unreachable  [unreachable]
+ static_frame/core/interface.py:1607: error: Statement is unreachable  [unreachable]

cloud-init (https://github.com/canonical/cloud-init)
+ cloudinit/url_helper.py:560: error: Invalid index type "str" for "dict[Literal['headers'], Any]"; expected type "Literal['headers']"  [index]

artigraph (https://github.com/artigraph/artigraph)
+ tests/arti/graphs/test_graph.py:156: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]
+ tests/arti/graphs/test_graph.py:305: error: Non-overlapping equality check (left operand type: "Literal[1]", right operand type: "Literal[2]")  [comparison-overlap]

AutoSplit (https://github.com/Toufool/AutoSplit)
+ src/utils.py:338:57: error: Non-overlapping equality check (left operand type: "Literal['linux']", right operand type: "Literal['win32']")  [comparison-overlap]
+ src/capture_method/__init__.py:124:4: error: Non-overlapping equality check (left operand type: "Literal['linux']", right operand type: "Literal['win32']")  [comparison-overlap]

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