Skip to content

Conversation

@tannguyencse19
Copy link
Contributor

Summary

Fix by promoting nested tuple element literals for unannotated method-initialized attributes

Fixes #1494

Test Plan

cargo test -p pyrefly test_unannotated_attribute_tuple_literal_promotion

@meta-cla meta-cla bot added the cla signed label Jan 3, 2026
@github-actions
Copy link

github-actions bot commented Jan 3, 2026

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

urllib3 (https://github.com/urllib3/urllib3)
+ ERROR src/urllib3/connection.py:811:33-53: Argument `bool | str | None` is not assignable to parameter `assert_hostname` with type `Literal[False] | str | None` in function `_ssl_wrap_socket_and_match_hostname` [bad-argument-type]
+ ERROR src/urllib3/connectionpool.py:1077:29-49: Argument `bool | str | None` is not assignable to parameter `assert_hostname` with type `Literal[False] | str | None` in function `urllib3._base_connection.BaseHTTPSConnection.__init__` [bad-argument-type]
+ ::error file=src/urllib3/connection.py,line=811,col=33,endLine=811,endColumn=53,title=Pyrefly bad-argument-type::Argument `bool | str | None` is not assignable to parameter `assert_hostname` with type `Literal[False] | str | None` in function `_ssl_wrap_socket_and_match_hostname`
+ ::error file=src/urllib3/connectionpool.py,line=1077,col=29,endLine=1077,endColumn=49,title=Pyrefly bad-argument-type::Argument `bool | str | None` is not assignable to parameter `assert_hostname` with type `Literal[False] | str | None` in function `urllib3._base_connection.BaseHTTPSConnection.__init__`

cibuildwheel (https://github.com/pypa/cibuildwheel)
+ ERROR cibuildwheel/options.py:681:78-91: Argument `str` is not assignable to parameter `platform` with type `Literal['android', 'ios', 'linux', 'macos', 'pyodide', 'windows']` in function `cibuildwheel.architecture.Architecture.parse_config` [bad-argument-type]
+ ERROR cibuildwheel/options.py:687:52-65: Argument `str` is not assignable to parameter `platform` with type `Literal['android', 'ios', 'linux', 'macos', 'pyodide', 'windows']` in function `cibuildwheel.architecture.Architecture.all_archs` [bad-argument-type]
+ ERROR cibuildwheel/options.py:938:22-35: Argument `str` is not assignable to parameter `platform` with type `Literal['android', 'ios', 'linux', 'macos', 'pyodide', 'windows']` in function `Options.__init__` [bad-argument-type]
+ ::error file=cibuildwheel/options.py,line=681,col=78,endLine=681,endColumn=91,title=Pyrefly bad-argument-type::Argument `str` is not assignable to parameter `platform` with type `Literal['android', 'ios', 'linux', 'macos', 'pyodide', 'windows']` in function `cibuildwheel.architecture.Architecture.parse_config`
+ ::error file=cibuildwheel/options.py,line=687,col=52,endLine=687,endColumn=65,title=Pyrefly bad-argument-type::Argument `str` is not assignable to parameter `platform` with type `Literal['android', 'ios', 'linux', 'macos', 'pyodide', 'windows']` in function `cibuildwheel.architecture.Architecture.all_archs`
+ ::error file=cibuildwheel/options.py,line=938,col=22,endLine=938,endColumn=35,title=Pyrefly bad-argument-type::Argument `str` is not assignable to parameter `platform` with type `Literal['android', 'ios', 'linux', 'macos', 'pyodide', 'windows']` in function `Options.__init__`

Tanjun (https://github.com/FasterSpeeding/Tanjun)
- ERROR tanjun/clients.py:1758:33-40: `MessageAcceptsEnum` is not assignable to attribute `_message_accepts` with type `Literal[MessageAcceptsEnum.ALL, MessageAcceptsEnum.NONE]` [bad-assignment]
- ::error file=tanjun/clients.py,line=1758,col=33,endLine=1758,endColumn=40,title=Pyrefly bad-assignment::`MessageAcceptsEnum` is not assignable to attribute `_message_accepts` with type `Literal[MessageAcceptsEnum.ALL, MessageAcceptsEnum.NONE]`

scikit-build-core (https://github.com/scikit-build/scikit-build-core)
+ ERROR src/scikit_build_core/hatch/plugin.py:167:39-171:22: No matching overload found for function `scikit_build_core.format.pyproject_format` called with arguments: (settings=ScikitBuildSettings, tags=WheelTag, state=str) [no-matching-overload]
+ ::error file=src/scikit_build_core/hatch/plugin.py,line=167,col=39,endLine=171,endColumn=22,title=Pyrefly no-matching-overload::No matching overload found for function `scikit_build_core.format.pyproject_format` called with arguments: (settings=ScikitBuildSettings, tags=WheelTag, state=str)%0A  Possible overloads:%0A  (*, settings: ScikitBuildSettings, state: Literal['editable', 'metadata_editable', 'metadata_wheel', 'sdist', 'wheel'] | None = ..., tags: WheelTag | None = ...) -> PyprojectFormatter [closest match]%0A  (*, dummy: Literal[True]) -> dict[str, str]

dulwich (https://github.com/dulwich/dulwich)
- ERROR dulwich/archive.py:86:28-43: `tuple[int, int]` is not assignable to attribute `pos` with type `tuple[Literal[0], Literal[0]]` [bad-assignment]
- ERROR dulwich/archive.py:94:28-43: `tuple[int, Literal[0]]` is not assignable to attribute `pos` with type `tuple[Literal[0], Literal[0]]` [bad-assignment]
- ::error file=dulwich/archive.py,line=86,col=28,endLine=86,endColumn=43,title=Pyrefly bad-assignment::`tuple[int, int]` is not assignable to attribute `pos` with type `tuple[Literal[0], Literal[0]]`
- ::error file=dulwich/archive.py,line=94,col=28,endLine=94,endColumn=43,title=Pyrefly bad-assignment::`tuple[int, Literal[0]]` is not assignable to attribute `pos` with type `tuple[Literal[0], Literal[0]]`

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ERROR tests/testing/mocks.py:279:26-50: `tuple[str, int, str]` is not assignable to attribute `_location` with type `tuple[Literal['/fake/path.py'], Literal[10], Literal['test_name']]` [bad-assignment]
- ::error file=ddtrace/vendor/psutil/_common.py,line=320,col=9,endLine=320,endColumn=19,title=Pyrefly bad-override::Class member `ZombieProcess.__reduce__` overrides parent class `NoSuchProcess` in an inconsistent manner%0A  `ZombieProcess.__reduce__` has type `BoundMethod[ZombieProcess, (self: ZombieProcess) -> tuple[type[ZombieProcess], tuple[Unknown, Unknown | None, Unknown | None, Literal['process no longer exists'] | Unknown]]]`, which is not assignable to `BoundMethod[ZombieProcess, (self: ZombieProcess) -> tuple[type[ZombieProcess], tuple[Unknown, Unknown | None, Literal['process no longer exists'] | Unknown]]]`, the type of `NoSuchProcess.__reduce__`
+ ::error file=ddtrace/vendor/psutil/_common.py,line=320,col=9,endLine=320,endColumn=19,title=Pyrefly bad-override::Class member `ZombieProcess.__reduce__` overrides parent class `NoSuchProcess` in an inconsistent manner%0A  `ZombieProcess.__reduce__` has type `BoundMethod[ZombieProcess, (self: ZombieProcess) -> tuple[type[ZombieProcess], tuple[Unknown, Unknown | None, Unknown | None, str | Unknown]]]`, which is not assignable to `BoundMethod[ZombieProcess, (self: ZombieProcess) -> tuple[type[ZombieProcess], tuple[Unknown, Unknown | None, str | Unknown]]]`, the type of `NoSuchProcess.__reduce__`
- ::error file=tests/testing/mocks.py,line=279,col=26,endLine=279,endColumn=50,title=Pyrefly bad-assignment::`tuple[str, int, str]` is not assignable to attribute `_location` with type `tuple[Literal['/fake/path.py'], Literal[10], Literal['test_name']]`

PyGithub (https://github.com/PyGithub/PyGithub)
- ERROR github/Requester.py:1185:34-1189:14: `tuple[int, int]` is not assignable to attribute `rate_limiting` with type `tuple[Literal[-1], Literal[-1]]` [bad-assignment]
- ::error file=github/Requester.py,line=1185,col=34,endLine=1189,endColumn=14,title=Pyrefly bad-assignment::`tuple[int, int]` is not assignable to attribute `rate_limiting` with type `tuple[Literal[-1], Literal[-1]]`

pyodide (https://github.com/pyodide/pyodide)
+ ERROR src/py/pyodide/console.py:184:25-36: Argument `str` is not assignable to parameter `return_mode` with type `Literal['last_expr', 'last_expr_or_assign', 'none']` in function `_pyodide._base.CodeRunner.__init__` [bad-argument-type]
+ ::error file=src/py/pyodide/console.py,line=184,col=25,endLine=184,endColumn=36,title=Pyrefly bad-argument-type::Argument `str` is not assignable to parameter `return_mode` with type `Literal['last_expr', 'last_expr_or_assign', 'none']` in function `_pyodide._base.CodeRunner.__init__`

pandera (https://github.com/pandera-dev/pandera)
+ ERROR pandera/backends/ibis/container.py:412:47-71: Argument `str` is not assignable to parameter `unique` with type `Literal['all', 'exclude_first', 'exclude_last']` in function `pandera.backends.utils.convert_uniquesettings` [bad-argument-type]
+ ::error file=pandera/backends/ibis/container.py,line=412,col=47,endLine=412,endColumn=71,title=Pyrefly bad-argument-type::Argument `str` is not assignable to parameter `unique` with type `Literal['all', 'exclude_first', 'exclude_last']` in function `pandera.backends.utils.convert_uniquesettings`

apprise (https://github.com/caronc/apprise)
- ERROR apprise/plugins/custom_form.py:226:21-35: `str | Unknown` is not assignable to attribute `attach_as` with type `LiteralString` [bad-assignment]
- ERROR apprise/plugins/custom_form.py:228:17-31: `str` is not assignable to attribute `attach_as` with type `LiteralString` [bad-assignment]
- ERROR apprise/plugins/custom_form.py:230:17-31: `str` is not assignable to attribute `attach_as` with type `LiteralString` [bad-assignment]
- ERROR apprise/plugins/custom_form.py:233:17-31: `str | Unknown` is not assignable to attribute `attach_as` with type `LiteralString` [bad-assignment]
- ERROR apprise/plugins/custom_form.py:235:21-35: `str | Unknown` is not assignable to attribute `attach_as` with type `LiteralString` [bad-assignment]
- ERROR apprise/plugins/pushover.py:297:28-30: `list[@_]` is not assignable to attribute `targets` with type `tuple[Literal['ALL_DEVICES']]` [bad-assignment]
+ ERROR apprise/plugins/pushover.py:297:28-30: `list[@_]` is not assignable to attribute `targets` with type `tuple[str]` [bad-assignment]
- ERROR apprise/plugins/resend.py:372:32-46: Argument `tuple[Literal[False] | str | Unknown, str | Any]` is not assignable to parameter `pair` with type `tuple[str | None, str]` in function `email.utils.formataddr` [bad-argument-type]
+ ERROR apprise/plugins/resend.py:372:32-46: Argument `tuple[bool | str | Unknown, str | Any]` is not assignable to parameter `pair` with type `tuple[str | None, str]` in function `email.utils.formataddr` [bad-argument-type]
- ::error file=apprise/plugins/custom_form.py,line=226,col=21,endLine=226,endColumn=35,title=Pyrefly bad-assignment::`str | Unknown` is not assignable to attribute `attach_as` with type `LiteralString`
- ::error file=apprise/plugins/custom_form.py,line=228,col=17,endLine=228,endColumn=31,title=Pyrefly bad-assignment::`str` is not assignable to attribute `attach_as` with type `LiteralString`
- ::error file=apprise/plugins/custom_form.py,line=230,col=17,endLine=230,endColumn=31,title=Pyrefly bad-assignment::`str` is not assignable to attribute `attach_as` with type `LiteralString`
- ::error file=apprise/plugins/custom_form.py,line=233,col=17,endLine=233,endColumn=31,title=Pyrefly bad-assignment::`str | Unknown` is not assignable to attribute `attach_as` with type `LiteralString`
- ::error file=apprise/plugins/custom_form.py,line=235,col=21,endLine=235,endColumn=35,title=Pyrefly bad-assignment::`str | Unknown` is not assignable to attribute `attach_as` with type `LiteralString`
- ::error file=apprise/plugins/pushover.py,line=297,col=28,endLine=297,endColumn=30,title=Pyrefly bad-assignment::`list[@_]` is not assignable to attribute `targets` with type `tuple[Literal['ALL_DEVICES']]`
+ ::error file=apprise/plugins/pushover.py,line=297,col=28,endLine=297,endColumn=30,title=Pyrefly bad-assignment::`list[@_]` is not assignable to attribute `targets` with type `tuple[str]`
- ::error file=apprise/plugins/resend.py,line=372,col=32,endLine=372,endColumn=46,title=Pyrefly bad-argument-type::Argument `tuple[Literal[False] | str | Unknown, str | Any]` is not assignable to parameter `pair` with type `tuple[str | None, str]` in function `email.utils.formataddr`
+ ::error file=apprise/plugins/resend.py,line=372,col=32,endLine=372,endColumn=46,title=Pyrefly bad-argument-type::Argument `tuple[bool | str | Unknown, str | Any]` is not assignable to parameter `pair` with type `tuple[str | None, str]` in function `email.utils.formataddr`

check-jsonschema (https://github.com/python-jsonschema/check-jsonschema)
+ ERROR src/check_jsonschema/checker.py:49:49-69: Argument `str` is not assignable to parameter `mode` with type `Literal['full', 'minimal', 'short']` in function `check_jsonschema.format_errors.print_error` [bad-argument-type]
+ ::error file=src/check_jsonschema/checker.py,line=49,col=49,endLine=49,endColumn=69,title=Pyrefly bad-argument-type::Argument `str` is not assignable to parameter `mode` with type `Literal['full', 'minimal', 'short']` in function `check_jsonschema.format_errors.print_error`

rotki (https://github.com/rotki/rotki)
+ ERROR rotkehlchen/api/v1/fields.py:508:25-33: `list[SUPPORTED_CHAIN_IDS] | None` is not assignable to attribute `limit_to` with type `list[ChainID] | None` [bad-assignment]
+ ERROR rotkehlchen/chain/bitcoin/manager.py:67:82-70:14: No matching overload found for function `rotkehlchen.db.dbhandler.DBHandler.get_single_blockchain_addresses` called with arguments: (cursor=DBCursor, blockchain=SupportedBlockchain) [no-matching-overload]
+ ERROR rotkehlchen/chain/bitcoin/manager.py:208:63-212:18: No matching overload found for function `rotkehlchen.db.dbhandler.DBHandler.get_dynamic_cache` called with arguments: (cursor=DBCursor, name=DBCacheDynamic, address=BTCAddress) [no-matching-overload]
+ ERROR rotkehlchen/chain/bitcoin/manager.py:248:48-253:18: No matching overload found for function `rotkehlchen.db.dbhandler.DBHandler.set_dynamic_cache` called with arguments: (write_cursor=DBCursor, name=DBCacheDynamic, value=int, address=BTCAddress) [no-matching-overload]
+ ERROR rotkehlchen/chain/evm/decoding/velodrome/decoder.py:480:27-55: Argument `list[CacheType]` is not assignable to parameter `key_parts` with type `Iterable[Literal[CacheType.AERODROME_GAUGE_ADDRESS, CacheType.AERODROME_GAUGE_BRIBE_ADDRESS, CacheType.AERODROME_GAUGE_FEE_ADDRESS, CacheType.AERODROME_POOL_ADDRESS, CacheType.BALANCER_V1_GAUGES, CacheType.BALANCER_V1_POOLS, CacheType.BALANCER_V2_GAUGES, CacheType.BALANCER_V2_POOLS, CacheType.BALANCER_V3_GAUGES, CacheType.BALANCER_V3_POOLS, CacheType.CONVEX_POOL_ADDRESS, CacheType.CURVE_CRVUSD_CONTROLLERS, CacheType.CURVE_LP_TOKENS, CacheType.CURVE_POOL_TOKENS, CacheType.EXTRAFI_REWARD_CONTRACTS, CacheType.GEARBOX_POOL_ADDRESS, CacheType.GEARBOX_POOL_LP_TOKENS, CacheType.MORPHO_REWARD_DISTRIBUTORS, CacheType.PENDLE_POOLS, CacheType.PENDLE_SY_TOKENS, CacheType.SPAM_ASSET_FALSE_POSITIVE, CacheType.STAKEDAO_GAUGES, CacheType.SUPERFLUID_SUPER_TOKENS, CacheType.VELODROME_GAUGE_ADDRESS, CacheType.VELODROME_GAUGE_BRIBE_ADDRESS, CacheType.VELODROME_GAUGE_FEE_ADDRESS, CacheType.VELODROME_POOL_ADDRESS] | str]` in function `rotkehlchen.globaldb.cache.globaldb_get_general_cache_values` [bad-argument-type]
+ ERROR rotkehlchen/chain/evm/decoding/velodrome/decoder.py:486:27-57: Argument `list[CacheType]` is not assignable to parameter `key_parts` with type `Iterable[Literal[CacheType.AERODROME_GAUGE_ADDRESS, CacheType.AERODROME_GAUGE_BRIBE_ADDRESS, CacheType.AERODROME_GAUGE_FEE_ADDRESS, CacheType.AERODROME_POOL_ADDRESS, CacheType.BALANCER_V1_GAUGES, CacheType.BALANCER_V1_POOLS, CacheType.BALANCER_V2_GAUGES, CacheType.BALANCER_V2_POOLS, CacheType.BALANCER_V3_GAUGES, CacheType.BALANCER_V3_POOLS, CacheType.CONVEX_POOL_ADDRESS, CacheType.CURVE_CRVUSD_CONTROLLERS, CacheType.CURVE_LP_TOKENS, CacheType.CURVE_POOL_TOKENS, CacheType.EXTRAFI_REWARD_CONTRACTS, CacheType.GEARBOX_POOL_ADDRESS, CacheType.GEARBOX_POOL_LP_TOKENS, CacheType.MORPHO_REWARD_DISTRIBUTORS, CacheType.PENDLE_POOLS, CacheType.PENDLE_SY_TOKENS, CacheType.SPAM_ASSET_FALSE_POSITIVE, CacheType.STAKEDAO_GAUGES, CacheType.SUPERFLUID_SUPER_TOKENS, CacheType.VELODROME_GAUGE_ADDRESS, CacheType.VELODROME_GAUGE_BRIBE_ADDRESS, CacheType.VELODROME_GAUGE_FEE_ADDRESS, CacheType.VELODROME_POOL_ADDRESS] | str]` in function `rotkehlchen.globaldb.cache.globaldb_get_general_cache_values` [bad-argument-type]
+ ::error file=rotkehlchen/api/v1/fields.py,line=508,col=25,endLine=508,endColumn=33,title=Pyrefly bad-assignment::`list[SUPPORTED_CHAIN_IDS] | None` is not assignable to attribute `limit_to` with type `list[ChainID] | None`
+ ::error file=rotkehlchen/chain/bitcoin/manager.py,line=67,col=82,endLine=70,endColumn=14,title=Pyrefly no-matching-overload::No matching overload found for function `rotkehlchen.db.dbhandler.DBHandler.get_single_blockchain_addresses` called with arguments: (cursor=DBCursor, blockchain=SupportedBlockchain)%0A  Possible overloads:%0A  (cursor: DBCursor, blockchain: SUPPORTED_EVM_EVMLIKE_CHAINS_TYPE) -> list[ChecksumAddress] [closest match]%0A  (cursor: DBCursor, blockchain: SUPPORTED_BITCOIN_CHAINS_TYPE) -> list[BTCAddress]%0A  (cursor: DBCursor, blockchain: SUPPORTED_SUBSTRATE_CHAINS_TYPE) -> list[SubstrateAddress]%0A  (cursor: DBCursor, blockchain: Literal[SupportedBlockchain.SOLANA]) -> list[SolanaAddress]
+ ::error file=rotkehlchen/chain/bitcoin/manager.py,line=208,col=63,endLine=212,endColumn=18,title=Pyrefly no-matching-overload::No matching overload found for function `rotkehlchen.db.dbhandler.DBHandler.get_dynamic_cache` called with arguments: (cursor=DBCursor, name=DBCacheDynamic, address=BTCAddress)%0A  Possible overloads:%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.LAST_CRYPTOTX_OFFSET], **kwargs: Unpack[LabeledLocationArgsType]) -> int | None%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.BINANCE_PAIR_LAST_ID], **kwargs: Unpack[BinancePairLastTradeArgsType]) -> int | None%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.LAST_QUERY_TS], **kwargs: Unpack[LabeledLocationIdArgsType]) -> Timestamp | None%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.LAST_QUERY_ID], **kwargs: Unpack[LabeledLocationIdArgsType]) -> str | None%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.LAST_BLOCK_ID], **kwargs: Unpack[LabeledLocationIdArgsType]) -> int | None%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.SOLANA_TOKEN_ACCOUNT], **kwargs: Unpack[AddressArgType]) -> tuple[SolanaAddress, SolanaAddress] | None [closest match]%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.WITHDRAWALS_TS], **kwargs: Unpack[AddressArgType]) -> Timestamp | None%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.WITHDRAWALS_IDX], **kwargs: Unpack[AddressArgType]) -> int | None%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.EXTRA_INTERNAL_TX], **kwargs: Unpack[ExtraTxArgType]) -> ChecksumAddress | None%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.LAST_PRODUCED_BLOCKS_QUERY_TS], **kwargs: Unpack[IndexArgType]) -> Timestamp | None%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.LAST_BCH_TX_BLOCK, DBCacheDynamic.LAST_BTC_TX_BLOCK], **kwargs: Unpack[AddressArgType]) -> int | None%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.LINEA_AIRDROP_ALLOCATION], **kwargs: Unpack[AddressArgType]) -> str | None%0A  (cursor: DBCursor, name: Literal[DBCacheDynamic.MATCHED_ASSET_MOVEMENT], **kwargs: Unpack[IdentifierArgType]) -> int | None
+ ::error file=rotkehlchen/chain/bitcoin/manager.py,line=248,col=48,endLine=253,endColumn=18,title=Pyrefly no-matching-overload::No matching overload found for function `rotkehlchen.db.dbhandler.DBHandler.set_dynamic_cache` called with arguments: (write_cursor=DBCursor, name=DBCacheDynamic, value=int, address=BTCAddress)%0A  Possible overloads:%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.LAST_CRYPTOTX_OFFSET], value: int, **kwargs: Unpack[LabeledLocationArgsType]) -> None%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.BINANCE_PAIR_LAST_ID], value: int, **kwargs: Unpack[BinancePairLastTradeArgsType]) -> None%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.LAST_QUERY_TS], value: Timestamp, **kwargs: Unpack[LabeledLocationIdArgsType]) -> None%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.LAST_QUERY_ID], value: int, **kwargs: Unpack[LabeledLocationIdArgsType]) -> None%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.LAST_BLOCK_ID], value: int, **kwargs: Unpack[LabeledLocationIdArgsType]) -> None%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.WITHDRAWALS_TS], value: Timestamp, **kwargs: Unpack[AddressArgType]) -> None%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.WITHDRAWALS_IDX], value: int, **kwargs: Unpack[AddressArgType]) -> None [closest match]%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.EXTRA_INTERNAL_TX], value: ChecksumAddress, **kwargs: Unpack[ExtraTxArgType]) -> None%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.LAST_PRODUCED_BLOCKS_QUERY_TS], value: Timestamp, **kwargs: Unpack[IndexArgType]) -> None%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.LAST_BCH_TX_BLOCK, DBCacheDynamic.LAST_BTC_TX_BLOCK], value: int, **kwargs: Unpack[AddressArgType]) -> None%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.LINEA_AIRDROP_ALLOCATION], value: str, **kwargs: Unpack[AddressArgType]) -> None%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.SOLANA_TOKEN_ACCOUNT], value: str, **kwargs: Unpack[AddressArgType]) -> None%0A  (write_cursor: DBCursor, name: Literal[DBCacheDynamic.MATCHED_ASSET_MOVEMENT], value: int, **kwargs: Unpack[IdentifierArgType]) -> None
+ ::error file=rotkehlchen/chain/evm/decoding/velodrome/decoder.py,line=480,col=27,endLine=480,endColumn=55,title=Pyrefly bad-argument-type::Argument `list[CacheType]` is not assignable to parameter `key_parts` with type `Iterable[Literal[CacheType.AERODROME_GAUGE_ADDRESS, CacheType.AERODROME_GAUGE_BRIBE_ADDRESS, CacheType.AERODROME_GAUGE_FEE_ADDRESS, CacheType.AERODROME_POOL_ADDRESS, CacheType.BALANCER_V1_GAUGES, CacheType.BALANCER_V1_POOLS, CacheType.BALANCER_V2_GAUGES, CacheType.BALANCER_V2_POOLS, CacheType.BALANCER_V3_GAUGES, CacheType.BALANCER_V3_POOLS, CacheType.CONVEX_POOL_ADDRESS, CacheType.CURVE_CRVUSD_CONTROLLERS, CacheType.CURVE_LP_TOKENS, CacheType.CURVE_POOL_TOKENS, CacheType.EXTRAFI_REWARD_CONTRACTS, CacheType.GEARBOX_POOL_ADDRESS, CacheType.GEARBOX_POOL_LP_TOKENS, CacheType.MORPHO_REWARD_DISTRIBUTORS, CacheType.PENDLE_POOLS, CacheType.PENDLE_SY_TOKENS, CacheType.SPAM_ASSET_FALSE_POSITIVE, CacheType.STAKEDAO_GAUGES, CacheType.SUPERFLUID_SUPER_TOKENS, CacheType.VELODROME_GAUGE_ADDRESS, CacheType.VELODROME_GAUGE_BRIBE_ADDRESS, CacheType.VELODROME_GAUGE_FEE_ADDRESS, CacheType.VELODROME_POOL_ADDRESS] | str]` in function `rotkehlchen.globaldb.cache.globaldb_get_general_cache_values`
+ ::error file=rotkehlchen/chain/evm/decoding/velodrome/decoder.py,line=486,col=27,endLine=486,endColumn=57,title=Pyrefly bad-argument-type::Argument `list[CacheType]` is not assignable to parameter `key_parts` with type `Iterable[Literal[CacheType.AERODROME_GAUGE_ADDRESS, CacheType.AERODROME_GAUGE_BRIBE_ADDRESS, CacheType.AERODROME_GAUGE_FEE_ADDRESS, CacheType.AERODROME_POOL_ADDRESS, CacheType.BALANCER_V1_GAUGES, CacheType.BALANCER_V1_POOLS, CacheType.BALANCER_V2_GAUGES, CacheType.BALANCER_V2_POOLS, CacheType.BALANCER_V3_GAUGES, CacheType.BALANCER_V3_POOLS, CacheType.CONVEX_POOL_ADDRESS, CacheType.CURVE_CRVUSD_CONTROLLERS, CacheType.CURVE_LP_TOKENS, CacheType.CURVE_POOL_TOKENS, CacheType.EXTRAFI_REWARD_CONTRACTS, CacheType.GEARBOX_POOL_ADDRESS, CacheType.GEARBOX_POOL_LP_TOKENS, CacheType.MORPHO_REWARD_DISTRIBUTORS, CacheType.PENDLE_POOLS, CacheType.PENDLE_SY_TOKENS, CacheType.SPAM_ASSET_FALSE_POSITIVE, CacheType.STAKEDAO_GAUGES, CacheType.SUPERFLUID_SUPER_TOKENS, CacheType.VELODROME_GAUGE_ADDRESS, CacheType.VELODROME_GAUGE_BRIBE_ADDRESS, CacheType.VELODROME_GAUGE_FEE_ADDRESS, CacheType.VELODROME_POOL_ADDRESS] | str]` in function `rotkehlchen.globaldb.cache.globaldb_get_general_cache_values`

strawberry (https://github.com/strawberry-graphql/strawberry)
- ERROR strawberry/django/views.py:93:32-43: `Literal['apollo-sandbox', 'graphiql', 'pathfinder'] | None` is not assignable to attribute `graphql_ide` with type `Literal['graphiql'] | None` [bad-assignment]
- ::error file=strawberry/django/views.py,line=93,col=32,endLine=93,endColumn=43,title=Pyrefly bad-assignment::`Literal['apollo-sandbox', 'graphiql', 'pathfinder'] | None` is not assignable to attribute `graphql_ide` with type `Literal['graphiql'] | None`
- ::error file=strawberry/django/views.py,line=148,col=5,endLine=148,endColumn=16,title=Pyrefly bad-override::Class member `GraphQLView.graphql_ide` overrides parent class `BaseView` in an inconsistent manner%0A  `GraphQLView.graphql_ide` has type `Literal['apollo-sandbox', 'graphiql', 'pathfinder'] | None`, which is not consistent with `Literal['graphiql'] | None` in `BaseView.graphql_ide` (the type of read-write attributes cannot be changed)
+ ::error file=strawberry/django/views.py,line=148,col=5,endLine=148,endColumn=16,title=Pyrefly bad-override::Class member `GraphQLView.graphql_ide` overrides parent class `BaseView` in an inconsistent manner%0A  `GraphQLView.graphql_ide` has type `Literal['apollo-sandbox', 'graphiql', 'pathfinder'] | None`, which is not consistent with `str | None` in `BaseView.graphql_ide` (the type of read-write attributes cannot be changed)
- ::error file=strawberry/django/views.py,line=197,col=5,endLine=197,endColumn=16,title=Pyrefly bad-override::Class member `AsyncGraphQLView.graphql_ide` overrides parent class `BaseView` in an inconsistent manner%0A  `AsyncGraphQLView.graphql_ide` has type `Literal['apollo-sandbox', 'graphiql', 'pathfinder'] | None`, which is not consistent with `Literal['graphiql'] | None` in `BaseView.graphql_ide` (the type of read-write attributes cannot be changed)
+ ::error file=strawberry/django/views.py,line=197,col=5,endLine=197,endColumn=16,title=Pyrefly bad-override::Class member `AsyncGraphQLView.graphql_ide` overrides parent class `BaseView` in an inconsistent manner%0A  `AsyncGraphQLView.graphql_ide` has type `Literal['apollo-sandbox', 'graphiql', 'pathfinder'] | None`, which is not consistent with `str | None` in `BaseView.graphql_ide` (the type of read-write attributes cannot be changed)

pandas (https://github.com/pandas-dev/pandas)
+ ERROR pandas/core/apply.py:1481:5-11: Class member `SeriesApply.by_row` overrides parent class `NDFrameApply` in an inconsistent manner [bad-override]
+ ERROR pandas/core/dtypes/dtypes.py:839:16-26: Returned type `str` is not assignable to declared return type `Literal['ms', 'ns', 's', 'us']` [bad-return]
+ ERROR pandas/core/resample.py:2581:20-31: Argument `str` is not assignable to parameter `closed` with type `Literal['left', 'right']` in function `_get_timestamp_range_edges` [bad-argument-type]
+ ERROR pandas/core/resample.py:2697:31-61: No matching overload found for function `pandas.core.base.IndexOpsMixin.searchsorted` called with arguments: (TimedeltaIndex | Unknown, side=str) [no-matching-overload]
+ ERROR pandas/core/resample.py:2770:24-35: Argument `str` is not assignable to parameter `closed` with type `Literal['left', 'right']` in function `_get_period_range_edges` [bad-argument-type]
+ ERROR pandas/io/json/_json.py:908:38-915:14: No matching overload found for function `pandas.io.common.get_handle` called with arguments: (str, Literal['r'], encoding=Unknown, compression=dict[str, Any] | str | None, storage_options=dict[str, Any] | None, errors=str | None) [no-matching-overload]
+ ERROR pandas/io/json/_json.py:974:60-78: Argument `_NoDefault | str` is not assignable to parameter `dtype_backend` with type `Literal['numpy', 'numpy_nullable', 'pyarrow'] | _NoDefault` in function `pandas.io._util.arrow_table_to_pandas` [bad-argument-type]
+ ERROR pandas/io/json/_json.py:999:56-74: Argument `str` is not assignable to parameter `dtype_backend` with type `Literal['numpy_nullable', 'pyarrow']` in function `pandas.core.generic.NDFrame.convert_dtypes` [bad-argument-type]
+ ERROR pandas/io/json/_json.py:1077:56-74: Argument `str` is not assignable to parameter `dtype_backend` with type `Literal['numpy_nullable', 'pyarrow']` in function `pandas.core.generic.NDFrame.convert_dtypes` [bad-argument-type]
- ERROR pandas/io/pytables.py:2092:15-34: `<` is not supported between `Literal[0]` and `None` [unsupported-operation]
+ ERROR pandas/io/pytables.py:2092:15-34: `<` is not supported between `int` and `None` [unsupported-operation]
- ERROR pandas/io/pytables.py:2093:24-48: `+` is not supported between `Literal[0]` and `None` [unsupported-operation]
+ ERROR pandas/io/pytables.py:2093:24-48: `+` is not supported between `int` and `None` [unsupported-operation]
+ ERROR pandas/io/stata.py:1092:29-1098:10: No matching overload found for function `pandas.io.common.get_handle` called with arguments: (PathLike[str] | ReadBuffer[bytes] | str, Literal['rb'], storage_options=dict[str, Any] | None, is_text=Literal[False], compression=dict[str, Any] | str | None) [no-matching-overload]
+ ERROR pandas/io/stata.py:2879:24-2885:10: No matching overload found for function `pandas.io.common.get_handle` called with arguments: (PathLike[str] | WriteBuffer[bytes] | str, Literal['wb'], compression=dict[str, Any] | str | None, is_text=Literal[False], storage_options=dict[str, Any] | None) [no-matching-overload]
+ ::error file=pandas/core/apply.py,line=1481,col=5,endLine=1481,endColumn=11,title=Pyrefly bad-override::Class member `SeriesApply.by_row` overrides parent class `NDFrameApply` in an inconsistent manner%0A  `SeriesApply.by_row` has type `Literal['_compat', 'compat', False]`, which is not consistent with `bool | str` in `NDFrameApply.by_row` (the type of read-write attributes cannot be changed)
+ ::error file=pandas/core/dtypes/dtypes.py,line=839,col=16,endLine=839,endColumn=26,title=Pyrefly bad-return::Returned type `str` is not assignable to declared return type `Literal['ms', 'ns', 's', 'us']`
- ::error file=pandas/core/resample.py,line=2297,col=9,endLine=2297,endColumn=29,title=Pyrefly bad-override::Class member `TimedeltaIndexResampler._get_binner_for_time` overrides parent class `DatetimeIndexResampler` in an inconsistent manner%0A  `TimedeltaIndexResampler._get_binner_for_time` has type `BoundMethod[TimedeltaIndexResampler, (self: TimedeltaIndexResampler) -> tuple[TimedeltaIndex, list[Unknown], TimedeltaIndex] | tuple[TimedeltaIndex, ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]], TimedeltaIndex | Unknown]]`, which is not assignable to `BoundMethod[TimedeltaIndexResampler, (self: TimedeltaIndexResampler) -> tuple[DatetimeIndex | Index, ndarray[tuple[Any, ...], dtype[Any]], DatetimeIndex | ndarray[tuple[Any, ...], dtype[Any]] | Unknown] | tuple[DatetimeIndex, list[Unknown], DatetimeIndex]]`, the type of `DatetimeIndexResampler._get_binner_for_time`
+ ::error file=pandas/core/resample.py,line=2297,col=9,endLine=2297,endColumn=29,title=Pyrefly bad-override::Class member `TimedeltaIndexResampler._get_binner_for_time` overrides parent class `DatetimeIndexResampler` in an inconsistent manner%0A  `TimedeltaIndexResampler._get_binner_for_time` has type `BoundMethod[TimedeltaIndexResampler, (self: TimedeltaIndexResampler) -> tuple[TimedeltaIndex, list[Unknown], TimedeltaIndex] | tuple[TimedeltaIndex, Unknown, TimedeltaIndex | Unknown]]`, which is not assignable to `BoundMethod[TimedeltaIndexResampler, (self: TimedeltaIndexResampler) -> tuple[DatetimeIndex | Index, ndarray[tuple[Any, ...], dtype[Any]], DatetimeIndex | ndarray[tuple[Any, ...], dtype[Any]] | Unknown] | tuple[DatetimeIndex, list[Unknown], DatetimeIndex]]`, the type of `DatetimeIndexResampler._get_binner_for_time`
+ ::error file=pandas/core/resample.py,line=2581,col=20,endLine=2581,endColumn=31,title=Pyrefly bad-argument-type::Argument `str` is not assignable to parameter `closed` with type `Literal['left', 'right']` in function `_get_timestamp_range_edges`
+ ::error file=pandas/core/resample.py,line=2697,col=31,endLine=2697,endColumn=61,title=Pyrefly no-matching-overload::No matching overload found for function `pandas.core.base.IndexOpsMixin.searchsorted` called with arguments: (TimedeltaIndex | Unknown, side=str)%0A  Possible overloads:%0A  (value: ScalarLike_co, side: Literal['left', 'right'] = ..., sorter: NumpySorter = ...) -> signedinteger[_NBitIntP]%0A  (value: Buffer | ExtensionArray | _NestedSequence[bytes | complex | str] | _NestedSequence[_SupportsArray[dtype[Any]]] | _SupportsArray[dtype[Any]] | bytes | complex | str, side: Literal['left', 'right'] = ..., sorter: NumpySorter = ...) -> ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]] [closest match]
+ ::error file=pandas/core/resample.py,line=2770,col=24,endLine=2770,endColumn=35,title=Pyrefly bad-argument-type::Argument `str` is not assignable to parameter `closed` with type `Literal['left', 'right']` in function `_get_period_range_edges`
+ ::error file=pandas/io/json/_json.py,line=908,col=38,endLine=915,endColumn=14,title=Pyrefly no-matching-overload::No matching overload found for function `pandas.io.common.get_handle` called with arguments: (str, Literal['r'], encoding=Unknown, compression=dict[str, Any] | str | None, storage_options=dict[str, Any] | None, errors=str | None)%0A  Possible overloads:%0A  (path_or_buf: BaseBuffer | PathLike[str] | str, mode: str, *, encoding: str | None = ..., compression: CompressionOptions = ..., memory_map: bool = ..., is_text: Literal[False], errors: str | None = ..., storage_options: StorageOptions = ...) -> IOHandles[bytes]%0A  (path_or_buf: BaseBuffer | PathLike[str] | str, mode: str, *, encoding: str | None = ..., compression: CompressionOptions = ..., memory_map: bool = ..., is_text: Literal[True] = ..., errors: str | None = ..., storage_options: StorageOptions = ...) -> IOHandles[str] [closest match]%0A  (path_or_buf: BaseBuffer | PathLike[str] | str, mode: str, *, encoding: str | None = ..., compression: CompressionOptions = ..., memory_map: bool = ..., is_text: bool = ..., errors: str | None = ..., storage_options: StorageOptions = ...) -> IOHandles[bytes] | IOHandles[str]
+ ::error file=pandas/io/json/_json.py,line=974,col=60,endLine=974,endColumn=78,title=Pyrefly bad-argument-type::Argument `_NoDefault | str` is not assignable to parameter `dtype_backend` with type `Literal['numpy', 'numpy_nullable', 'pyarrow'] | _NoDefault` in function `pandas.io._util.arrow_table_to_pandas`
+ ::error file=pandas/io/json/_json.py,line=999,col=56,endLine=999,endColumn=74,title=Pyrefly bad-argument-type::Argument `str` is not assignable to parameter `dtype_backend` with type `Literal['numpy_nullable', 'pyarrow']` in function `pandas.core.generic.NDFrame.convert_dtypes`
+ ::error file=pandas/io/json/_json.py,line=1077,col=56,endLine=1077,endColumn=74,title=Pyrefly bad-argument-type::Argument `str` is not assignable to parameter `dtype_backend` with type `Literal['numpy_nullable', 'pyarrow']` in function `pandas.core.generic.NDFrame.convert_dtypes`
- ::error file=pandas/io/pytables.py,line=2092,col=15,endLine=2092,endColumn=34,title=Pyrefly unsupported-operation::`<` is not supported between `Literal[0]` and `None`%0A  Argument `None` is not assignable to parameter `value` with type `int` in function `int.__lt__`
+ ::error file=pandas/io/pytables.py,line=2092,col=15,endLine=2092,endColumn=34,title=Pyrefly unsupported-operation::`<` is not supported between `int` and `None`%0A  Argument `None` is not assignable to parameter `value` with type `int` in function `int.__lt__`
- ::error file=pandas/io/pytables.py,line=2093,col=24,endLine=2093,endColumn=48,title=Pyrefly unsupported-operation::`+` is not supported between `Literal[0]` and `None`%0A  Argument `None` is not assignable to parameter `value` with type `int` in function `int.__add__`
+ ::error file=pandas/io/pytables.py,line=2093,col=24,endLine=2093,endColumn=48,title=Pyrefly unsupported-operation::`+` is not supported between `int` and `None`%0A  Argument `None` is not assignable to parameter `value` with type `int` in function `int.__add__`
+ ::error file=pandas/io/stata.py,line=1092,col=29,endLine=1098,endColumn=10,title=Pyrefly no-matching-overload::No matching overload found for function `pandas.io.common.get_handle` called with arguments: (PathLike[str] | ReadBuffer[bytes] | str, Literal['rb'], storage_options=dict[str, Any] | None, is_text=Literal[False], compression=dict[str, Any] | str | None)%0A  Possible overloads:%0A  (path_or_buf: BaseBuffer | PathLike[str] | str, mode: str, *, encoding: str | None = ..., compression: CompressionOptions = ..., memory_map: bool = ..., is_text: Literal[False], errors: str | None = ..., storage_options: StorageOptions = ...) -> IOHandles[bytes] [closest match]%0A  (path_or_buf: BaseBuffer | PathLike[str] | str, mode: str, *, encoding: str | None = ..., compression: CompressionOptions = ..., memory_map: bool = ..., is_text: Literal[True] = ..., errors: str | None = ..., storage_options: StorageOptions = ...) -> IOHandles[str]%0A  (path_or_buf: BaseBuffer | PathLike[str] | str, mode: str, *, encoding: str | None = ..., compression: CompressionOptions = ..., memory_map: bool = ..., is_text: bool = ..., errors: str | None = ..., storage_options: StorageOptions = ...) -> IOHandles[bytes] | IOHandles[str]
+ ::error file=pandas/io/stata.py,line=2879,col=24,endLine=2885,endColumn=10,title=Pyrefly no-matching-overload::No matching overload found for function `pandas.io.common.get_handle` called with arguments: (PathLike[str] | WriteBuffer[bytes] | str, Literal['wb'], compression=dict[str, Any] | str | None, is_text=Literal[False], storage_options=dict[str, Any] | None)%0A  Possible overloads:%0A  (path_or_buf: BaseBuffer | PathLike[str] | str, mode: str, *, encoding: str | None = ..., compression: CompressionOptions = ..., memory_map: bool = ..., is_text: Literal[False], errors: str | None = ..., storage_options: StorageOptions = ...) -> IOHandles[bytes] [closest match]%0A  (path_or_buf: BaseBuffer | PathLike[str] | str, mode: str, *, encoding: str | None = ..., compression: CompressionOptions = ..., memory_map: bool = ..., is_text: Literal[True] = ..., errors: str | None = ..., storage_options: StorageOptions = ...) -> IOHandles[str]%0A  (path_or_buf: BaseBuffer | PathLike[str] | str, mode: str, *, encoding: str | None = ..., compression: CompressionOptions = ..., memory_map: bool = ..., is_text: bool = ..., errors: str | None = ..., storage_options: StorageOptions = ...) -> IOHandles[bytes] | IOHandles[str]

nox (https://github.com/wntrblm/nox)
+ ERROR nox/_decorators.py:171:29-49: Argument `str | None` is not assignable to parameter `download_python` with type `Literal['always', 'auto', 'never'] | None` in function `Func.__init__` [bad-argument-type]
+ ERROR nox/sessions.py:1035:29-44: Argument `str | Any` is not assignable to parameter `download_python` with type `Literal['always', 'auto', 'never']` in function `nox.virtualenv.get_virtualenv` [bad-argument-type]
+ ::error file=nox/_decorators.py,line=171,col=29,endLine=171,endColumn=49,title=Pyrefly bad-argument-type::Argument `str | None` is not assignable to parameter `download_python` with type `Literal['always', 'auto', 'never'] | None` in function `Func.__init__`
+ ::error file=nox/sessions.py,line=1035,col=29,endLine=1035,endColumn=44,title=Pyrefly bad-argument-type::Argument `str | Any` is not assignable to parameter `download_python` with type `Literal['always', 'auto', 'never']` in function `nox.virtualenv.get_virtualenv`

vision (https://github.com/pytorch/vision)
- ERROR torchvision/transforms/transforms.py:813:83-87: Argument `Literal[0] | Number | Sequence[Unknown] | list[float]` is not assignable to parameter `fill` with type `list[float] | None` in function `torchvision.transforms.functional.perspective` [bad-argument-type]
+ ERROR torchvision/transforms/transforms.py:813:83-87: Argument `Number | Sequence[Unknown] | int | list[float]` is not assignable to parameter `fill` with type `list[float] | None` in function `torchvision.transforms.functional.perspective` [bad-argument-type]
- ERROR torchvision/transforms/transforms.py:1380:83-87: Argument `Literal[0] | Number | Sequence[Unknown] | list[float]` is not assignable to parameter `fill` with type `list[float] | None` in function `torchvision.transforms.functional.rotate` [bad-argument-type]
+ ERROR torchvision/transforms/transforms.py:1380:83-87: Argument `Number | Sequence[Unknown] | int | list[float]` is not assignable to parameter `fill` with type `list[float] | None` in function `torchvision.transforms.functional.rotate` [bad-argument-type]
- ERROR torchvision/transforms/transforms.py:1537:75-79: Argument `Literal[0] | Number | Sequence[Unknown] | list[float]` is not assignable to parameter `fill` with type `list[float] | None` in function `torchvision.transforms.functional.affine` [bad-argument-type]
+ ERROR torchvision/transforms/transforms.py:1537:75-79: Argument `Number | Sequence[Unknown] | int | list[float]` is not assignable to parameter `fill` with type `list[float] | None` in function `torchvision.transforms.functional.affine` [bad-argument-type]
- ::error file=torchvision/transforms/transforms.py,line=813,col=83,endLine=813,endColumn=87,title=Pyrefly bad-argument-type::Argument `Literal[0] | Number | Sequence[Unknown] | list[float]` is not assignable to parameter `fill` with type `list[float] | None` in function `torchvision.transforms.functional.perspective`
+ ::error file=torchvision/transforms/transforms.py,line=813,col=83,endLine=813,endColumn=87,title=Pyrefly bad-argument-type::Argument `Number | Sequence[Unknown] | int | list[float]` is not assignable to parameter `fill` with type `list[float] | None` in function `torchvision.transforms.functional.perspective`
- ::error file=torchvision/transforms/transforms.py,line=1380,col=83,endLine=1380,endColumn=87,title=Pyrefly bad-argument-type::Argument `Literal[0] | Number | Sequence[Unknown] | list[float]` is not assignable to parameter `fill` with type `list[float] | None` in function `torchvision.transforms.functional.rotate`
+ ::error file=torchvision/transforms/transforms.py,line=1380,col=83,endLine=1380,endColumn=87,title=Pyrefly bad-argument-type::Argument `Number | Sequence[Unknown] | int | list[float]` is not assignable to parameter `fill` with type `list[float] | None` in function `torchvision.transforms.functional.rotate`
- ::error file=torchvision/transforms/transforms.py,line=1537,col=75,endLine=1537,endColumn=79,title=Pyrefly bad-argument-type::Argument `Literal[0] | Number | Sequence[Unknown] | list[float]` is not assignable to parameter `fill` with type `list[float] | None` in function `torchvision.transforms.functional.affine`
+ ::error file=torchvision/transforms/transforms.py,line=1537,col=75,endLine=1537,endColumn=79,title=Pyrefly bad-argument-type::Argument `Number | Sequence[Unknown] | int | list[float]` is not assignable to parameter `fill` with type `list[float] | None` in function `torchvision.transforms.functional.affine`

pycryptodome (https://github.com/Legrandin/pycryptodome)
- ERROR lib/Crypto/Cipher/ChaCha20.py:140:22-34: `tuple[Literal['encrypt']]` is not assignable to attribute `_next` with type `tuple[Literal['encrypt'], Literal['decrypt']]` [bad-assignment]
+ ERROR lib/Crypto/Cipher/ChaCha20.py:140:22-34: `tuple[Literal['encrypt']]` is not assignable to attribute `_next` with type `tuple[str, str]` [bad-assignment]
- ERROR lib/Crypto/Cipher/ChaCha20.py:186:22-34: `tuple[Literal['decrypt']]` is not assignable to attribute `_next` with type `tuple[Literal['encrypt'], Literal['decrypt']]` [bad-assignment]
+ ERROR lib/Crypto/Cipher/ChaCha20.py:186:22-34: `tuple[Literal['decrypt']]` is not assignable to attribute `_next` with type `tuple[str, str]` [bad-assignment]
- ERROR lib/Crypto/Cipher/ChaCha20_Poly1305.py:127:22-43: `tuple[Literal['encrypt'], Literal['digest']]` is not assignable to attribute `_next` with type `tuple[Literal['update'], Literal['encrypt'], Literal['decrypt'], Literal['digest'], Literal['verify']]` [bad-assignment]
+ ERROR lib/Crypto/Cipher/ChaCha20_Poly1305.py:127:22-43: `tuple[Literal['encrypt'], Literal['digest']]` is not assignable to attribute `_next` with type `tuple[str, str, str, str, str]` [bad-assignment]
- ERROR lib/Crypto/Cipher/ChaCha20_Poly1305.py:156:22-43: `tuple[Literal['decrypt'], Literal['verify']]` is not assignable to attribute `_next` with type `tuple[Literal['update'], Literal['encrypt'], Literal['decrypt'], Literal['digest'], Literal['verify']]` [bad-assignment]
+ ERROR lib/Crypto/Cipher/ChaCha20_Poly1305.py:156:22-43: `tuple[Literal['decrypt'], Literal['verify']]` is not assignable to attribute `_next` with type `tuple[str, str, str, str, str]` [bad-assignment]
- ERROR lib/Crypto/Cipher/ChaCha20_Poly1305.py:192:22-33: `tuple[Literal['digest']]` is not assignable to attribute `_next` with type `tuple[Literal['update'], Literal['encrypt'], Literal['decrypt'], Literal['digest'], Literal['verify']]` [bad-assignment]
+ ERROR lib/Crypto/Cipher/ChaCha20_Poly1305.py:192:22-33: `tuple[Literal['digest']]` is not assignable to attribute `_next` with type `tuple[str, str, str, str, str]` [bad-assignment]
- ERROR lib/Crypto/Cipher/ChaCha20_Poly1305.py:222:22-33: `tuple[Literal['verify']]` is not assignable to attribute `_next` with type `tuple[Literal['update'], Literal['encrypt'], Literal['decrypt'], Literal['digest'], Literal['verify']]` [bad-assignment]
+ ERROR lib/Crypto/Cipher/ChaCha20_Poly1305.py:222:22-33: `tuple[Literal['verify']]` is not assignable to attribute `_next` with type `tuple[str, str, str, str, str]` [bad-assignment]
- ::error file=lib/Crypto/Cipher/ChaCha20.py,line=140,col=22,endLine=140,endColumn=34,title=Pyrefly bad-assignment::`tuple[Literal['encrypt']]` is not assignable to attribute `_next` with type `tuple[Literal['encrypt'], Literal['decrypt']]`
+ ::error file=lib/Crypto/Cipher/ChaCha20.py,line=140,col=22,endLine=140,endColumn=34,title=Pyrefly bad-assignment::`tuple[Literal['encrypt']]` is not assignable to attribute `_next` with type `tuple[str, str]`
- ::error file=lib/Crypto/Cipher/ChaCha20.py,line=186,col=22,endLine=186,endColumn=34,title=Pyrefly bad-assignment::`tuple[Literal['decrypt']]` is not assignable to attribute `_next` with type `tuple[Literal['encrypt'], Literal['decrypt']]`
+ ::error file=lib/Crypto/Cipher/ChaCha20.py,line=186,col=22,endLine=186,endColumn=34,title=Pyrefly bad-assignment::`tuple[Literal['decrypt']]` is not assignable to attribute `_next` with type `tuple[str, str]`
- ::error file=lib/Crypto/Cipher/ChaCha20_Poly1305.py,line=127,col=22,endLine=127,endColumn=43,title=Pyrefly bad-assignment::`tuple[Literal['encrypt'], Literal['digest']]` is not assignable to attribute `_next` with type `tuple[Literal['update'], Literal['encrypt'], Literal['decrypt'], Literal['digest'], Literal['verify']]`
+ ::error file=lib/Crypto/Cipher/ChaCha20_Poly1305.py,line=127,col=22,endLine=127,endColumn=43,title=Pyrefly bad-assignment::`tuple[Literal['encrypt'], Literal['digest']]` is not assignable to attribute `_next` with type `tuple[str, str, str, str, str]`
- ::error file=lib/Crypto/Cipher/ChaCha20_Poly1305.py,line=156,col=22,endLine=156,endColumn=43,title=Pyrefly bad-assignment::`tuple[Literal['decrypt'], Literal['verify']]` is not assignable to attribute `_next` with type `tuple[Literal['update'], Literal['encrypt'], Literal['decrypt'], Literal['digest'], Literal['verify']]`
+ ::error file=lib/Crypto/Cipher/ChaCha20_Poly1305.py,line=156,col=22,endLine=156,endColumn=43,title=Pyrefly bad-assignment::`tuple[Literal['decrypt'], Literal['verify']]` is not assignable to attribute `_next` with type `tuple[str, str, str, str, str]`
- ::error file=lib/Crypto/Cipher/ChaCha20_Poly1305.py,line=192,col=22,endLine=192,endColumn=33,title=Pyrefly bad-assignment::`tuple[Literal['digest']]` is not assignable to attribute `_next` with type `tuple[Literal['update'], Literal['encrypt'], Literal['decrypt'], Literal['digest'], Literal['verify']]`
+ ::error file=lib/Crypto/Cipher/ChaCha20_Poly1305.py,line=192,col=22,endLine=192,endColumn=33,title=Pyrefly bad-assignment::`tuple[Literal['digest']]` is not assignable to attribute `_next` with type `tuple[str, str, str, str, str]`
- ::error file=lib/Crypto/Cipher/ChaCha20_Poly1305.py,line=222,col=22,endLine=222,endColumn=33,title=Pyrefly bad-assignment::`tuple[Literal['verify']]` is not assignable to attribute `_next` with type `tuple[Literal['update'], Literal['encrypt'], Literal['decrypt'], Literal['digest'], Literal['verify']]`
+ ::error file=lib/Crypto/Cipher/ChaCha20_Poly1305.py,line=222,col=22,endLine=222,endColumn=33,title=Pyrefly bad-assignment::`tuple[Literal['verify']]` is not assignable to attribute `_next` with type `tuple[str, str, str, str, str]`

setuptools (https://github.com/pypa/setuptools)
- ERROR setuptools/_distutils/command/build_ext.py:328:21-33: Argument `Literal[0, 1] | bool` is not assignable to parameter `verbose` with type `bool` in function `setuptools._distutils.compilers.C.base.new_compiler` [bad-argument-type]
+ ERROR setuptools/_distutils/command/build_ext.py:328:21-33: Argument `bool | int` is not assignable to parameter `verbose` with type `bool` in function `setuptools._distutils.compilers.C.base.new_compiler` [bad-argument-type]
- ERROR setuptools/_distutils/command/install.py:488:40-75: No matching overload found for function `posixpath.join` called with arguments: (str | None, Literal[''] | Unknown) [no-matching-overload]
+ ERROR setuptools/_distutils/command/install.py:488:40-75: No matching overload found for function `posixpath.join` called with arguments: (str | None, str | Unknown) [no-matching-overload]
- ERROR setuptools/_distutils/command/install_lib.py:153:25-37: Argument `Literal[0, 1] | bool` is not assignable to parameter `verbose` with type `bool` in function `setuptools._distutils.util.byte_compile` [bad-argument-type]
+ ERROR setuptools/_distutils/command/install_lib.py:153:25-37: Argument `bool | int` is not assignable to parameter `verbose` with type `bool` in function `setuptools._distutils.util.byte_compile` [bad-argument-type]
+ ERROR setuptools/_vendor/platformdirs/windows.py:49:28-43: No matching overload found for function `posixpath.join` called with arguments: (str, *list[bool | str]) [no-matching-overload]

... (truncated 47 lines) ...```

Copy link
Contributor

@rchen152 rchen152 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looking at the mypy_primer output, I suspect this PR is running into a pre-existing bug involving over-eager literal promotion when type annotations are inherited, but I'll look into patching that internally.

@meta-codesync
Copy link

meta-codesync bot commented Jan 8, 2026

@rchen152 has imported this pull request. If you are a Meta employee, you can view this in D90353484.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pyrefly should promote literals when inferring tuple types for attributes

2 participants