Skip to content

Conversation

@oconnor663
Copy link
Contributor

@oconnor663 oconnor663 commented Oct 31, 2025

astral-sh/ty#742. This PR rewrites and supersedes my previous NewType PR, #20126. The high-level changes:

  • I've taken @AlexWaygood's advice and added Type::NewTypeInstance instead of expanding NominalInstanceInner.
  • Rebasing on top of [ty] defer inference of legacy TypeVar bound/constraints/defaults #20598 required a rewrite of how the bindings are wired up. Now it's a new special case alongside infer_legacy_typevar in TypeInferenceBuilder::infer_assignment_definition_impl.
  • Related to that, inference of the base type is now deferred. This makes it possible to support cyclic newtypes, and there's a section of test cases for this in the new mdtests.

There are several // REVIEWERS: questions inline, and I expect I've gone about some things the wrong way (particularly cycle detection?), so I'm leaving this in Draft status for now. I've moved this out of Draft.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

Diagnostic diff on typing conformance tests

Changes were detected when running ty on typing conformance tests
--- old-output.txt	2025-11-06 22:46:32.505249634 +0000
+++ new-output.txt	2025-11-06 22:46:35.797264599 +0000
@@ -1,4 +1,4 @@
-fatal[panic] Panicked at /home/runner/.cargo/git/checkouts/salsa-e6f3bb7c2a062968/05a9af7/src/function/execute.rs:451:17 when checking `/home/runner/work/ruff/ruff/typing/conformance/tests/aliases_typealiastype.py`: `infer_definition_types(Id(18b71)): execute: too many cycle iterations`
+fatal[panic] Panicked at /home/runner/.cargo/git/checkouts/salsa-e6f3bb7c2a062968/05a9af7/src/function/execute.rs:451:17 when checking `/home/runner/work/ruff/ruff/typing/conformance/tests/aliases_typealiastype.py`: `infer_definition_types(Id(18f71)): execute: too many cycle iterations`
 _directives_deprecated_library.py:15:31: error[invalid-return-type] Function always implicitly returns `None`, which is not assignable to return type `int`
 _directives_deprecated_library.py:30:26: error[invalid-return-type] Function always implicitly returns `None`, which is not assignable to return type `str`
 _directives_deprecated_library.py:36:41: error[invalid-return-type] Function always implicitly returns `None`, which is not assignable to return type `Self@__add__`
@@ -41,11 +41,19 @@
 aliases_implicit.py:119:10: error[invalid-type-form] Variable of type `Literal["int | str"]` is not allowed in a type expression
 aliases_implicit.py:128:1: error[type-assertion-failure] Argument does not have asserted type `list[str]`
 aliases_implicit.py:133:6: error[call-non-callable] Object of type `UnionType` is not callable
-aliases_newtype.py:15:1: error[type-assertion-failure] Argument does not have asserted type `int`
-aliases_newtype.py:18:1: error[invalid-assignment] Object of type `NewType` is not assignable to `type`
-aliases_newtype.py:23:16: error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `type | UnionType | tuple[Unknown, ...]`, found `NewType`
-aliases_newtype.py:26:21: error[invalid-base] Invalid class base with type `NewType`
-aliases_newtype.py:63:43: error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 3, got 4
+aliases_newtype.py:11:8: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["user"]`
+aliases_newtype.py:12:1: error[invalid-assignment] Object of type `Literal[42]` is not assignable to `UserId`
+aliases_newtype.py:18:1: error[invalid-assignment] Object of type `<NewType pseudo-class 'UserId'>` is not assignable to `type`
+aliases_newtype.py:23:16: error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `type | UnionType | tuple[Unknown, ...]`, found `<NewType pseudo-class 'UserId'>`
+aliases_newtype.py:26:21: error[invalid-base] Cannot subclass an instance of NewType
+aliases_newtype.py:35:1: error[invalid-newtype] The name of a `NewType` (`BadName`) must match the name of the variable it is assigned to (`GoodName`)
+aliases_newtype.py:41:6: error[invalid-type-form] `GoodNewType1` is a `NewType` and cannot be specialized
+aliases_newtype.py:47:38: error[invalid-newtype] invalid base for `typing.NewType`: type `int | str`
+aliases_newtype.py:52:38: error[invalid-newtype] invalid base for `typing.NewType`: type `Hashable`
+aliases_newtype.py:54:38: error[invalid-newtype] invalid base for `typing.NewType`: type `Literal[7]`
+aliases_newtype.py:61:38: error[invalid-newtype] invalid base for `typing.NewType`: type `TD1`
+aliases_newtype.py:63:15: error[invalid-newtype] Wrong number of arguments in `NewType` creation, expected 2, found 3
+aliases_newtype.py:65:38: error[invalid-newtype] invalid base for `typing.NewType`: type `Any`
 aliases_type_statement.py:10:19: error[too-many-positional-arguments] Too many positional arguments: expected 1, got 3
 aliases_type_statement.py:17:1: error[unresolved-attribute] Object of type `typing.TypeAliasType` has no attribute `bit_count`
 aliases_type_statement.py:19:1: error[call-non-callable] Object of type `TypeAliasType` is not callable
@@ -587,7 +595,7 @@
 generics_typevartuple_basic.py:12:14: error[invalid-argument-type] `@Todo(starred expression)` is not a valid argument to `Generic`
 generics_typevartuple_basic.py:16:26: error[invalid-return-type] Function always implicitly returns `None`, which is not assignable to return type `tuple[@Todo(PEP 646), ...]`
 generics_typevartuple_basic.py:23:13: error[invalid-argument-type] `@Todo(starred expression)` is not a valid argument to `Generic`
-generics_typevartuple_basic.py:42:34: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `tuple[@Todo(PEP 646), ...]`, found `Literal[1]`
+generics_typevartuple_basic.py:42:34: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `tuple[@Todo(PEP 646), ...]`, found `Height`
 generics_typevartuple_basic.py:65:27: error[unknown-argument] Argument `covariant` does not match any known parameter of function `__new__`
 generics_typevartuple_basic.py:66:27: error[too-many-positional-arguments] Too many positional arguments to function `__new__`: expected 2, got 4
 generics_typevartuple_basic.py:67:27: error[unknown-argument] Argument `bound` does not match any known parameter of function `__new__`
@@ -1002,5 +1010,5 @@
 typeddicts_usage.py:28:17: error[missing-typed-dict-key] Missing required key 'name' in TypedDict `Movie` constructor
 typeddicts_usage.py:28:18: error[invalid-key] Invalid key for TypedDict `Movie`: Unknown key "title"
 typeddicts_usage.py:40:24: error[invalid-type-form] The special form `typing.TypedDict` is not allowed in type expressions. Did you mean to use a concrete TypedDict or `collections.abc.Mapping[str, object]` instead?
-Found 1004 diagnostics
+Found 1012 diagnostics
 WARN A fatal error occurred while checking some files. Not all project files were analyzed. See the diagnostics list above for details.

@AlexWaygood AlexWaygood added the ty Multi-file analysis & type inference label Oct 31, 2025
@AlexWaygood AlexWaygood changed the title implement typing.NewType as Type::NewTypeInstance [ty] implement typing.NewType as Type::NewTypeInstance Oct 31, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-argument-type 495 1 3
unused-ignore-comment 0 39 0
unsupported-operator 5 0 4
invalid-assignment 4 1 0
invalid-return-type 2 1 2
type-assertion-failure 2 0 2
invalid-newtype 2 0 0
no-matching-overload 2 0 0
call-non-callable 0 0 1
non-subscriptable 1 0 0
unresolved-attribute 0 0 1
Total 513 42 13

Full report with detailed diff (timing results)

@AlexWaygood

This comment was marked as resolved.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

(I just looked at the // REVIEWER comments for now, since it's still in draft, but happy to look at the other bits if you'd like me to!)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

mypy_primer results

Changes were detected when running on open source projects
paroxython (https://github.com/laowantong/paroxython)
+ paroxython/__init__.py:55:31: error[invalid-argument-type] Argument to function `main` is incorrect: Expected `Source`, found `str`
- Found 5 diagnostics
+ Found 6 diagnostics

asynq (https://github.com/quora/asynq)
+ asynq/tools.py:467:28: error[unsupported-operator] Operator `-` is unsupported between objects of type `Utime` and `Unknown | None | Utime`
- Found 171 diagnostics
+ Found 172 diagnostics

websockets (https://github.com/aaugustin/websockets)
- src/websockets/server.py:110:17: error[unresolved-attribute] Object of type `(ServerProtocol, Sequence[@Todo], /) -> @Todo | None` has no attribute `__get__`
+ src/websockets/server.py:110:17: error[unresolved-attribute] Object of type `(ServerProtocol, Sequence[Subprotocol], /) -> Subprotocol | None` has no attribute `__get__`

kopf (https://github.com/nolar/kopf)
- kopf/_cogs/clients/creating.py:13:20: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_cogs/clients/creating.py:27:22: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_cogs/clients/fetching.py:13:20: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_cogs/clients/patching.py:11:20: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_cogs/clients/watching.py:55:20: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_cogs/clients/watching.py:109:20: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_cogs/clients/watching.py:168:20: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_cogs/clients/watching.py:235:20: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_cogs/structs/bodies.py:159:28: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_cogs/structs/bodies.py:160:21: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_cogs/structs/references.py:199:24: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_cogs/structs/references.py:492:21: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_core/engines/indexing.py:12:13: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_core/engines/peering.py:93:20: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_core/engines/peering.py:166:20: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_core/engines/peering.py:209:20: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_core/engines/peering.py:241:20: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_core/reactor/orchestration.py:44:16: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_core/reactor/orchestration.py:173:42: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_core/reactor/orchestration.py:193:32: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_core/reactor/orchestration.py:234:38: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- kopf/_core/reactor/queueing.py:123:20: error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
- Found 85 diagnostics
+ Found 63 diagnostics

mypy-protobuf (https://github.com/dropbox/mypy-protobuf)
+ test/test_generated_mypy.py:484:5: error[type-assertion-failure] Argument does not have asserted type `UserId`
- test/test_generated_mypy.py:486:5: error[type-assertion-failure] Argument does not have asserted type `ScalarMap[@Todo, Email]`
+ test/test_generated_mypy.py:486:5: error[type-assertion-failure] Argument does not have asserted type `ScalarMap[UserId, Email]`
+ test/test_generated_mypy.py:495:5: error[type-assertion-failure] Argument does not have asserted type `UserId`
- test/test_generated_mypy.py:497:5: error[type-assertion-failure] Argument does not have asserted type `ScalarMap[@Todo, Email]`
+ test/test_generated_mypy.py:497:5: error[type-assertion-failure] Argument does not have asserted type `ScalarMap[UserId, Email]`
- Found 56 diagnostics
+ Found 58 diagnostics

rich (https://github.com/Textualize/rich)
+ tests/test_progress.py:57:17: error[invalid-argument-type] Argument is incorrect: Expected `TaskID`, found `Literal[1]`
+ tests/test_progress.py:66:17: error[invalid-argument-type] Argument is incorrect: Expected `TaskID`, found `Literal[1]`
+ tests/test_progress.py:71:17: error[invalid-argument-type] Argument is incorrect: Expected `TaskID`, found `Literal[1]`
+ tests/test_progress.py:78:17: error[invalid-argument-type] Argument is incorrect: Expected `TaskID`, found `Literal[1]`
+ tests/test_progress.py:88:17: error[invalid-argument-type] Argument is incorrect: Expected `TaskID`, found `Literal[1]`
+ tests/test_progress.py:92:28: error[invalid-argument-type] Argument is incorrect: Expected `TaskID`, found `Literal[1]`
+ tests/test_progress.py:125:17: error[invalid-argument-type] Argument is incorrect: Expected `TaskID`, found `Literal[1]`
+ tests/test_progress.py:138:17: error[invalid-argument-type] Argument is incorrect: Expected `TaskID`, found `Literal[1]`
+ tests/test_progress.py:154:22: error[invalid-argument-type] Argument is incorrect: Expected `TaskID`, found `Literal[1]`
+ tests/test_progress.py:162:22: error[invalid-argument-type] Argument is incorrect: Expected `TaskID`, found `Literal[1]`
- Found 316 diagnostics
+ Found 326 diagnostics

trio (https://github.com/python-trio/trio)
+ src/trio/_core/_generated_io_windows.py:112:68: error[invalid-argument-type] Argument to bound method `notify_closing` is incorrect: Expected `int | _HasFileNo`, found `Handle | int | _HasFileNo`
+ src/trio/_tests/test_wait_for_object.py:149:43: error[invalid-argument-type] Argument to bound method `cast` is incorrect: Expected `_CDataBase | int`, found `Handle`
+ src/trio/_tests/test_wait_for_object.py:200:43: error[invalid-argument-type] Argument to bound method `cast` is incorrect: Expected `_CDataBase | int`, found `Handle`
+ src/trio/_wait_for_object.py:63:9: error[invalid-assignment] Cannot assign to object of type `HandleArray` with no `__setitem__` method
- Found 595 diagnostics
+ Found 599 diagnostics

meson (https://github.com/mesonbuild/meson)
+ mesonbuild/build.py:2813:89: error[invalid-argument-type] Argument to bound method `single_use` is incorrect: Expected `SubProject`, found `str`
+ mesonbuild/build.py:2885:40: error[invalid-argument-type] Argument is incorrect: Expected `SubProject`, found `str`
+ mesonbuild/build.py:3084:40: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `SubProject`, found `str`
+ mesonbuild/build.py:3128:40: error[invalid-argument-type] Argument is incorrect: Expected `SubProject`, found `str`
+ mesonbuild/build.py:3188:40: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `SubProject`, found `str`
+ mesonbuild/interpreter/interpreter.py:167:98: error[invalid-argument-type] Argument to bound method `single_use` is incorrect: Expected `SubProject`, found `str`
+ mesonbuild/interpreter/interpreter.py:170:76: error[invalid-argument-type] Argument to bound method `single_use` is incorrect: Expected `SubProject`, found `str`
+ mesonbuild/interpreter/interpreter.py:173:82: error[invalid-argument-type] Argument to bound method `single_use` is incorrect: Expected `SubProject`, found `str`
+ mesonbuild/interpreter/interpreter.py:259:71: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `SubProject`, found `str`
+ mesonbuild/interpreter/interpreter.py:1442:34: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `SubProject`, found `str`
- mesonbuild/interpreterbase/decorators.py:45:12: error[invalid-return-type] Return type does not match returned value: expected `tuple[BaseNode, list[@Todo], Any, @Todo]`, found `tuple[Any, None | Any, None | Any, Any]`
+ mesonbuild/interpreterbase/decorators.py:45:12: error[invalid-return-type] Return type does not match returned value: expected `tuple[BaseNode, list[@Todo], Any, SubProject]`, found `tuple[Any, None | Any, None | Any, Any]`
+ unittests/datatests.py:249:42: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `SubProject`, found `Literal[""]`
+ unittests/platformagnostictests.py:41:43: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `SubProject`, found `Literal[""]`
+ unittests/platformagnostictests.py:75:43: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `SubProject`, found `Literal[""]`
- Found 1660 diagnostics
+ Found 1673 diagnostics

strawberry (https://github.com/strawberry-graphql/strawberry)
- strawberry/federation/schema.py:62:9: error[invalid-assignment] Object of type `list[Unknown | NewType]` is not assignable to `Iterable[type]`
- strawberry/schema/schema_converter.py:807:37: error[invalid-argument-type] Argument to bound method `from_scalar` is incorrect: Expected `type`, found `NewType`
+ strawberry/schema/schema_converter.py:807:37: error[invalid-argument-type] Argument to bound method `from_scalar` is incorrect: Expected `type`, found `<NewType pseudo-class 'ID'>`
- strawberry/schema/types/scalar.py:60:36: error[invalid-argument-type] Argument to function `_get_scalar_definition` is incorrect: Expected `type`, found `NewType`
- strawberry/types/arguments.py:237:45: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- Found 376 diagnostics
+ Found 373 diagnostics

bokeh (https://github.com/bokeh/bokeh)
+ src/bokeh/models/widgets/buttons.py:225:49: error[invalid-argument-type] Argument is incorrect: Expected `ID`, found `Literal["help"]`
+ src/bokeh/server/views/autoload_js_handler.py:88:57: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ID | None`, found `str & ~AlwaysFalsy`
+ src/bokeh/server/views/session_handler.py:87:9: error[invalid-assignment] Object of type `str | None` is not assignable to `ID | None`
+ src/bokeh/server/views/session_handler.py:92:13: error[invalid-assignment] Object of type `Unknown | str | None` is not assignable to `ID | None`
- Found 628 diagnostics
+ Found 632 diagnostics

rotki (https://github.com/rotki/rotki)
- rotkehlchen/accounting/pot.py:456:61: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/accounting/structures/processed_event.py:151:42: error[no-matching-overload] No overload of bound method `sub` matches arguments
- rotkehlchen/api/rest.py:2907:38: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/api/rest.py:2915:89: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/api/rest.py:2967:21: error[invalid-argument-type] Argument to bound method `query_transactions` is incorrect: Expected `list[ChecksumAddress]`, found `list[BTCAddress] | list[ChecksumAddress] | list[SubstrateAddress] | list[SolanaAddress] | Unknown`
+ rotkehlchen/api/rest.py:4567:21: error[invalid-argument-type] Argument to bound method `get_or_create_transaction` is incorrect: Expected `ChecksumAddress | None`, found `ChecksumAddress | SolanaAddress`
+ rotkehlchen/api/rest.py:4572:21: error[invalid-argument-type] Argument to bound method `add_transaction_by_hash` is incorrect: Expected `ChecksumAddress`, found `ChecksumAddress | SolanaAddress`
- rotkehlchen/api/rest.py:5905:73: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/assets/asset.py:59:32: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/assets/asset.py:597:32: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/assets/asset.py:603:43: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/assets/asset.py:773:43: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/assets/utils.py:118:45: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/assets/utils.py:574:96: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/balances/historical.py:73:13: error[invalid-assignment] Method `__setitem__` of type `bound method dict[Asset, HistoricalBalance].__setitem__(key: Asset, value: HistoricalBalance, /) -> None` cannot be called with a key of type `Unknown` and a value of type `dict[Unknown | str, Unknown | FVal]` on object of type `dict[Asset, HistoricalBalance]`
+ rotkehlchen/balances/historical.py:73:13: error[invalid-assignment] Method `__setitem__` of type `bound method dict[Asset, HistoricalBalance].__setitem__(key: Asset, value: HistoricalBalance, /) -> None` cannot be called with a key of type `Unknown` and a value of type `dict[Unknown | str, Unknown | Price]` on object of type `dict[Asset, HistoricalBalance]`
- rotkehlchen/chain/aggregator.py:586:98: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/aggregator.py:721:50: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/chain/aggregator.py:583:9: error[no-matching-overload] No overload of bound method `set` matches arguments
+ rotkehlchen/chain/aggregator.py:587:72: error[invalid-argument-type] Argument to bound method `query_balances` is incorrect: Expected `Sequence[ChecksumAddress]`, found `Unknown | tuple[ChecksumAddress, ...] | list[BTCAddress] | ... omitted 3 union elements`
+ rotkehlchen/chain/bitcoin/manager.py:67:13: error[invalid-assignment] Object of type `Unknown | list[ChecksumAddress]` is not assignable to attribute `tracked_accounts` of type `list[BTCAddress]`
+ rotkehlchen/chain/decoding/tools.py:97:13: error[invalid-argument-type] Argument to function `decode_transfer_direction` is incorrect: Argument type `A@BaseDecoderTools` does not satisfy constraints (`BTCAddress`, `ChecksumAddress`, `SubstrateAddress`, `SolanaAddress`) of type variable `AnyBlockchainAddress`
- rotkehlchen/chain/ethereum/interfaces/ammswap/ammswap.py:96:41: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/ethereum/modules/curve/crvusd/decoder.py:70:72: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/ethereum/modules/eth2/eth2.py:609:37: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/ethereum/modules/liquity/decoder.py:81:117: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/ethereum/modules/liquity/decoder.py:148:117: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/ethereum/modules/liquity/decoder.py:235:117: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/ethereum/modules/liquity/decoder.py:274:117: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/ethereum/modules/thegraph/accountant.py:30:69: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/chain/ethereum/modules/yearn/decoder.py:171:62: error[invalid-argument-type] Argument to function `_get_vault_token_name` is incorrect: Expected `ChecksumAddress`, found `Unknown | ChecksumAddress | None`
- rotkehlchen/chain/ethereum/modules/yearn/decoder.py:404:13: error[invalid-return-type] Return type does not match returned value: expected `dict[@Todo, str]`, found `dict[@Todo, Literal["yearn-v1", "yearn-v2"]]`
+ rotkehlchen/chain/ethereum/modules/yearn/decoder.py:404:13: error[invalid-return-type] Return type does not match returned value: expected `dict[ChecksumAddress, str]`, found `dict[ChecksumAddress, Literal["yearn-v1", "yearn-v2"]]`
- rotkehlchen/chain/evm/decoding/aave/v2/decoder.py:136:16: error[invalid-return-type] Return type does not match returned value: expected `dict[@Todo, str]`, found `dict[@Todo, Literal["aave-v2"]]`
- rotkehlchen/chain/evm/decoding/gearbox/decoder.py:299:73: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/evm/decoding/pendle/decoder.py:512:66: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/evm/decoding/pendle/decoder.py:516:70: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/evm/decoding/stakedao/decoder.py:91:67: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/chain/evm/decoding/spark/savings/decoder.py:225:13: error[unsupported-operator] Operator `|=` is unsupported between objects of type `dict[Unknown, tuple[bound method Self@addresses_to_decoders._decode_spark_tokens_deposit_withdrawal(context: DecoderContext) -> EvmDecodingOutput]]` and `dict[Unknown | ChecksumAddress, Unknown | tuple[bound method Self@addresses_to_decoders._decode_psm_deposit_withdrawal(context: DecoderContext) -> EvmDecodingOutput]]`
- rotkehlchen/chain/evm/decoding/thegraph/balances.py:139:43: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `tuple[@Todo, @Todo, @Todo, int]`, found `tuple[@Todo, Unknown]`
+ rotkehlchen/chain/evm/decoding/thegraph/balances.py:139:43: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `tuple[ChecksumAddress, ChecksumAddress, ChecksumAddress, int]`, found `tuple[@Todo, Unknown]`
- rotkehlchen/chain/evm/decoding/zerox/decoder.py:146:65: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/evm/decoding/zerox/decoder.py:176:67: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/evm/decoding/zerox/decoder.py:250:97: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/evm/names.py:63:94: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/evm/names.py:67:73: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/chain/evm/proxies_inquirer.py:154:21: error[invalid-argument-type] Argument to bound method `make` is incorrect: Expected `list[str] | None`, found `list[ChecksumAddress]`
- rotkehlchen/chain/evm/transactions.py:217:100: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/evm/transactions.py:339:91: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/chain/zksync_lite/manager.py:646:39: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `tuple[int, HistoryEventType, HistoryEventSubType, Asset, FVal, ChecksumAddress, ChecksumAddress | None, str]`, found `tuple[Literal[0], Literal[HistoryEventType.WITHDRAWAL], Literal[HistoryEventSubType.BRIDGE], Asset, FVal, ChecksumAddress | None, None, str]`
- rotkehlchen/chain/zksync_lite/manager.py:700:42: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/data_migrations/migrations/migrations_18.py:56:49: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/db/dbhandler.py:1413:86: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/db/dbhandler.py:1417:90: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/db/dbhandler.py:1421:90: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/db/dbhandler.py:1425:78: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/db/dbhandler.py:2576:9: error[no-matching-overload] No overload of bound method `update` matches arguments
- rotkehlchen/db/history_events.py:347:61: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/externalapis/cryptocompare.py:414:41: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Unknown]`, found `list[dict[str, Any]] | Price`
+ rotkehlchen/externalapis/cryptocompare.py:415:26: error[non-subscriptable] Cannot subscript object of type `Price` with no `__getitem__` method
- rotkehlchen/externalapis/cryptocompare.py:425:22: error[unsupported-operator] Operator `*` is unsupported between objects of type `list[dict[str, Any]] | @Todo` and `list[dict[str, Any]] | @Todo`
+ rotkehlchen/externalapis/cryptocompare.py:425:22: error[unsupported-operator] Operator `*` is unsupported between objects of type `list[dict[str, Any]] | Price` and `list[dict[str, Any]] | Price`
- rotkehlchen/externalapis/etherscan.py:332:40: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/externalapis/etherscan.py:337:38: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/externalapis/etherscan.py:441:47: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/externalapis/etherscan.py:523:84: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/inquirer.py:1059:16: error[invalid-return-type] Return type does not match returned value: expected `Price | None`, found `int | float`
+ rotkehlchen/inquirer.py:1269:20: error[invalid-return-type] Return type does not match returned value: expected `Price | None`, found `FVal`
- rotkehlchen/tests/api/test_ens.py:62:94: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/tests/api/test_ens.py:66:73: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/tests/db/test_db.py:361:9: error[invalid-argument-type] Argument to bound method `add_queried_address_for_module` is incorrect: Expected `ChecksumAddress`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/db/test_db.py:366:13: error[invalid-argument-type] Argument to bound method `save_tokens_for_address` is incorrect: Expected `ChecksumAddress`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/db/test_db.py:372:13: error[invalid-argument-type] Argument to bound method `save_tokens_for_address` is incorrect: Expected `ChecksumAddress`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/db/test_db.py:384:13: error[no-matching-overload] No overload of bound method `set_dynamic_cache` matches arguments
+ rotkehlchen/tests/db/test_db.py:411:17: error[invalid-argument-type] Argument to bound method `remove_single_blockchain_accounts` is incorrect: Expected `list[BTCAddress] | list[ChecksumAddress] | list[SubstrateAddress] | list[SolanaAddress]`, found `list[Unknown | str]`
+ rotkehlchen/tests/db/test_db.py:431:13: error[invalid-argument-type] Argument to bound method `remove_single_blockchain_accounts` is incorrect: Expected `list[BTCAddress] | list[ChecksumAddress] | list[SubstrateAddress] | list[SolanaAddress]`, found `list[Unknown | str]`
+ rotkehlchen/tests/db/test_db.py:443:13: error[invalid-argument-type] Argument to bound method `get_tokens_for_address` is incorrect: Expected `ChecksumAddress`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/db/test_db.py:449:13: error[invalid-argument-type] Argument to bound method `get_tokens_for_address` is incorrect: Expected `ChecksumAddress`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/db/test_db.py:614:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `int`
+ rotkehlchen/tests/db/test_db.py:731:13: error[invalid-argument-type] Argument to bound method `query_timed_balances` is incorrect: Expected `Timestamp | None`, found `Literal[1451606401]`
+ rotkehlchen/tests/db/test_db.py:732:13: error[invalid-argument-type] Argument to bound method `query_timed_balances` is incorrect: Expected `Timestamp | None`, found `Literal[1485907100]`
+ rotkehlchen/tests/db/test_db.py:744:13: error[invalid-argument-type] Argument to bound method `query_timed_balances` is incorrect: Expected `Timestamp | None`, found `Literal[1451606300]`
+ rotkehlchen/tests/db/test_db.py:745:13: error[invalid-argument-type] Argument to bound method `query_timed_balances` is incorrect: Expected `Timestamp | None`, found `Literal[1485907000]`
+ rotkehlchen/tests/db/test_db.py:1152:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp | None`, found `Literal[1451606400]`
+ rotkehlchen/tests/db/test_db.py:1153:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1451616500]`
+ rotkehlchen/tests/db/test_db.py:1163:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp | None`, found `Literal[1451626500]`
+ rotkehlchen/tests/db/test_db.py:1164:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1451636500]`
+ rotkehlchen/tests/db/test_db.py:1174:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp | None`, found `Literal[1452636501]`
+ rotkehlchen/tests/db/test_db.py:1175:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1459836501]`
+ rotkehlchen/tests/db/test_db.py:1282:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676728]`
+ rotkehlchen/tests/db/test_db.py:1288:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676728]`
+ rotkehlchen/tests/db/test_db.py:1306:17: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676728]`
+ rotkehlchen/tests/db/test_db.py:1312:17: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676728]`
+ rotkehlchen/tests/db/test_db.py:1332:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676728]`
+ rotkehlchen/tests/db/test_db.py:1338:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676728]`
+ rotkehlchen/tests/db/test_db.py:1344:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676729]`
+ rotkehlchen/tests/db/test_db.py:1350:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676829]`
+ rotkehlchen/tests/db/test_db.py:1356:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590677829]`
+ rotkehlchen/tests/db/test_db.py:1362:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590677829]`
+ rotkehlchen/tests/db/test_db.py:1368:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590777829]`
+ rotkehlchen/tests/db/test_db.py:1374:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590877829]`
+ rotkehlchen/tests/db/test_db.py:1380:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590877829]`
+ rotkehlchen/tests/db/test_db.py:1386:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590877829]`
+ rotkehlchen/tests/db/test_db.py:1400:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590877829]`
+ rotkehlchen/tests/db/test_db.py:1413:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676728]`
+ rotkehlchen/tests/db/test_db.py:1418:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676729]`
+ rotkehlchen/tests/db/test_db.py:1423:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590677829]`
+ rotkehlchen/tests/db/test_db.py:1427:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590777829]`
+ rotkehlchen/tests/db/test_db.py:1432:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590877829]`
+ rotkehlchen/tests/db/test_db.py:1461:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676728]`
+ rotkehlchen/tests/db/test_db.py:1467:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676728]`
+ rotkehlchen/tests/db/test_db.py:1480:59: error[invalid-argument-type] Argument to bound method `query_timed_balances` is incorrect: Expected `Timestamp | None`, found `Literal[0]`
+ rotkehlchen/tests/db/test_db.py:1480:70: error[invalid-argument-type] Argument to bound method `query_timed_balances` is incorrect: Expected `Timestamp | None`, found `Literal[1590676728]`
+ rotkehlchen/tests/db/test_db.py:1485:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676728]`
+ rotkehlchen/tests/db/test_db.py:1489:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1590676728]`
+ rotkehlchen/tests/db/test_db.py:1574:59: error[invalid-argument-type] Argument is incorrect: Expected `ApiKey`, found `str`
+ rotkehlchen/tests/db/test_db.py:1599:13: error[invalid-argument-type] Argument to bound method `add_queried_address_for_module` is incorrect: Expected `ChecksumAddress`, found `Literal["0xd36029d76af6fE4A356528e4Dc66B2C18123597D"]`
- rotkehlchen/tests/db/test_db.py:1602:16: error[unsupported-operator] Operator `in` is not supported for types `str` and `None`, in comparing `Literal["0xd36029d76af6fE4A356528e4Dc66B2C18123597D"]` with `tuple[@Todo, ...] | None`
+ rotkehlchen/tests/db/test_db.py:1602:16: error[unsupported-operator] Operator `in` is not supported for types `str` and `None`, in comparing `Literal["0xd36029d76af6fE4A356528e4Dc66B2C18123597D"]` with `tuple[ChecksumAddress, ...] | None`
+ rotkehlchen/tests/db/test_db.py:1608:13: error[invalid-argument-type] Argument to bound method `remove_single_blockchain_accounts` is incorrect: Expected `list[BTCAddress] | list[ChecksumAddress] | list[SubstrateAddress] | list[SolanaAddress]`, found `list[Unknown | str]`
+ rotkehlchen/tests/db/test_ens.py:77:17: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `int`
+ rotkehlchen/tests/db/test_ens.py:95:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `int`
+ rotkehlchen/tests/db/test_ens.py:100:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `int`
+ rotkehlchen/tests/db/test_ens.py:176:13: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `int`
+ rotkehlchen/tests/db/test_evmtx.py:116:83: error[invalid-argument-type] Argument to bound method `make` is incorrect: Expected `EVMTxHash | None`, found `Literal[b"dsadsad"]`
+ rotkehlchen/tests/db/test_history_events.py:43:17: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `EVMTxHash`
+ rotkehlchen/tests/db/test_history_events.py:58:21: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `EVMTxHash`
+ rotkehlchen/tests/db/test_history_events.py:67:21: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `EVMTxHash`
+ rotkehlchen/tests/db/test_history_events.py:81:17: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `EVMTxHash`
+ rotkehlchen/tests/db/test_history_events.py:214:25: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ChecksumAddress | None`, found `Unknown | str`
+ rotkehlchen/tests/db/test_ranges.py:13:72: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[0]`
+ rotkehlchen/tests/db/test_ranges.py:13:75: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[2]`
+ rotkehlchen/tests/db/test_ranges.py:15:72: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[8]`
+ rotkehlchen/tests/db/test_ranges.py:15:75: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[17]`
+ rotkehlchen/tests/db/test_ranges.py:17:72: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[19]`
+ rotkehlchen/tests/db/test_ranges.py:17:76: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[23]`
+ rotkehlchen/tests/db/test_ranges.py:19:72: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[22]`
+ rotkehlchen/tests/db/test_ranges.py:19:76: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[57]`
+ rotkehlchen/tests/db/test_ranges.py:21:72: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[26]`
+ rotkehlchen/tests/db/test_ranges.py:21:76: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[125]`
+ rotkehlchen/tests/db/test_ranges.py:24:72: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[3]`
+ rotkehlchen/tests/db/test_ranges.py:24:75: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[9]`
+ rotkehlchen/tests/db/test_ranges.py:26:72: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[9]`
+ rotkehlchen/tests/db/test_ranges.py:26:75: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[17]`
+ rotkehlchen/tests/db/test_ranges.py:28:72: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[19]`
+ rotkehlchen/tests/db/test_ranges.py:28:76: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[23]`
+ rotkehlchen/tests/db/test_ranges.py:30:72: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[120]`
+ rotkehlchen/tests/db/test_ranges.py:30:77: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[250]`
+ rotkehlchen/tests/db/test_ranges.py:32:72: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[126]`
+ rotkehlchen/tests/db/test_ranges.py:32:77: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[170]`
+ rotkehlchen/tests/db/test_ranges.py:47:77: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[12]`
+ rotkehlchen/tests/db/test_ranges.py:47:87: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[90]`
+ rotkehlchen/tests/db/test_ranges.py:51:13: error[invalid-argument-type] Argument to bound method `update_used_query_range` is incorrect: Expected `list[tuple[Timestamp, Timestamp]]`, found `list[tuple[int, int] | Unknown]`
+ rotkehlchen/tests/db/test_ranges.py:57:77: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[250]`
+ rotkehlchen/tests/db/test_ranges.py:57:87: error[invalid-argument-type] Argument to bound method `get_location_query_ranges` is incorrect: Expected `Timestamp`, found `Literal[500]`
+ rotkehlchen/tests/db/test_ranges.py:61:13: error[invalid-argument-type] Argument to bound method `update_used_query_range` is incorrect: Expected `list[tuple[Timestamp, Timestamp]]`, found `list[tuple[int, int] | Unknown]`
- rotkehlchen/tests/db/test_reports.py:199:31: error[call-non-callable] Object of type `list[Unknown | int]` is not callable
+ rotkehlchen/tests/db/test_reports.py:199:31: error[call-non-callable] Object of type `list[Unknown | Timestamp]` is not callable
+ rotkehlchen/tests/exchanges/test_binance.py:57:36: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_binance.py:57:41: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_binance_us.py:27:38: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_binance_us.py:27:43: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_bitcoinde.py:46:40: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_bitcoinde.py:46:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_bitfinex.py:131:38: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_bitfinex.py:131:43: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_bitmex.py:33:34: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_bitmex.py:33:39: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_bitstamp.py:37:38: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_bitstamp.py:37:43: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_cryptocom.py:30:40: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_cryptocom.py:30:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_cryptocom.py:37:40: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_cryptocom.py:37:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_iconomi.py:31:36: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_iconomi.py:31:41: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_independentreserve.py:24:58: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_independentreserve.py:24:63: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_independentreserve.py:31:58: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_independentreserve.py:31:63: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_kraken.py:85:34: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_kraken.py:85:39: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"YQ=="]`
+ rotkehlchen/tests/exchanges/test_kraken.py:815:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_kraken.py:815:37: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"YW55IGNhcm5hbCBwbGVhc3VyZS4="]`
+ rotkehlchen/tests/exchanges/test_kraken.py:1079:9: error[invalid-argument-type] Argument to function `query_api_create_and_get_report` is incorrect: Expected `Timestamp`, found `Literal[0]`
+ rotkehlchen/tests/exchanges/test_kraken.py:1080:9: error[invalid-argument-type] Argument to function `query_api_create_and_get_report` is incorrect: Expected `Timestamp`, found `Literal[1640493377]`
+ rotkehlchen/tests/exchanges/test_kraken.py:1094:9: error[invalid-argument-type] Argument to function `query_api_create_and_get_report` is incorrect: Expected `Timestamp`, found `Literal[0]`
+ rotkehlchen/tests/exchanges/test_kraken.py:1095:9: error[invalid-argument-type] Argument to function `query_api_create_and_get_report` is incorrect: Expected `Timestamp`, found `Literal[1640493377]`
+ rotkehlchen/tests/exchanges/test_kucoin.py:38:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_kucoin.py:39:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_okx.py:23:28: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_okx.py:23:33: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_poloniex.py:53:38: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_poloniex.py:53:43: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/exchanges/test_woo.py:25:27: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["a"]`
+ rotkehlchen/tests/exchanges/test_woo.py:25:32: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"a"]`
+ rotkehlchen/tests/external_apis/test_blockscout.py:107:36: error[invalid-argument-type] Argument to bound method `has_activity` is incorrect: Expected `ChecksumAddress`, found `Literal["0x3C69Bc9B9681683890ad82953Fe67d13Cd91D5EE"]`
+ rotkehlchen/tests/external_apis/test_blockscout.py:108:36: error[invalid-argument-type] Argument to bound method `has_activity` is incorrect: Expected `ChecksumAddress`, found `Literal["0x014cd0535b2Ea668150a681524392B7633c8681c"]`
+ rotkehlchen/tests/external_apis/test_blockscout.py:109:36: error[invalid-argument-type] Argument to bound method `has_activity` is incorrect: Expected `ChecksumAddress`, found `Literal["0x6c66149E65c517605e0a2e4F707550ca342f9c1B"]`
+ rotkehlchen/tests/external_apis/test_cryptocompare.py:101:9: error[invalid-argument-type] Argument to bound method `query_and_store_historical_data` is incorrect: Expected `Timestamp`, found `Literal[1287957545]`
+ rotkehlchen/tests/external_apis/test_cryptocompare.py:125:9: error[invalid-argument-type] Argument to bound method `query_and_store_historical_data` is incorrect: Expected `Timestamp`, found `Literal[1289159945]`
+ rotkehlchen/tests/external_apis/test_cryptocompare.py:174:9: error[invalid-argument-type] Argument to bound method `query_and_store_historical_data` is incorrect: Expected `Timestamp`, found `Literal[1287957545]`
+ rotkehlchen/tests/external_apis/test_defillama.py:96:9: error[invalid-argument-type] Argument to bound method `query_historical_price` is incorrect: Expected `Timestamp`, found `Literal[1597024800]`
+ rotkehlchen/tests/external_apis/test_etherscan.py:52:82: error[invalid-argument-type] Argument is incorrect: Expected `ApiKey`, found `str & ~AlwaysFalsy`
+ rotkehlchen/tests/external_apis/test_etherscan.py:123:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1439048640]`
+ rotkehlchen/tests/external_apis/test_etherscan.py:125:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress`, found `Literal["0x5153493bB1E1642A63A098A65dD3913daBB6AE24"]`
+ rotkehlchen/tests/external_apis/test_etherscan.py:208:13: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress`, found `Literal["0xC951900c341aBbb3BAfbf7ee2029377071Dbc36A"]`
+ rotkehlchen/tests/external_apis/test_etherscan.py:209:13: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x2910543Af39abA0Cd09dBb2D50200b3E800A63D2"]`
+ rotkehlchen/tests/external_apis/test_etherscan.py:225:13: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress | None`, found `Literal["0xC951900c341aBbb3BAfbf7ee2029377071Dbc36A"]`
+ rotkehlchen/tests/external_apis/test_gnosispay.py:78:57: error[invalid-argument-type] Argument to bound method `query_remote_for_tx_and_update_events` is incorrect: Expected `Timestamp`, found `Literal[0]`
+ rotkehlchen/tests/external_apis/test_gnosispay.py:78:69: error[invalid-argument-type] Argument to bound method `query_remote_for_tx_and_update_events` is incorrect: Expected `Timestamp`, found `Literal[1]`
+ rotkehlchen/tests/external_apis/test_google_calendar.py:325:13: error[invalid-argument-type] Argument is incorrect: Expected `HexColorCode | None`, found `Literal["FF0000"]`
+ rotkehlchen/tests/external_apis/test_google_calendar.py:338:13: error[invalid-argument-type] Argument is incorrect: Expected `HexColorCode | None`, found `Literal["00FF00"]`
+ rotkehlchen/tests/external_apis/test_google_calendar.py:376:13: error[invalid-argument-type] Argument is incorrect: Expected `HexColorCode | None`, found `Literal["0000FF"]`
+ rotkehlchen/tests/external_apis/test_xratescom.py:29:9: error[invalid-argument-type] Argument to function `get_historical_xratescom_exchange_rates` is incorrect: Expected `Timestamp`, found `Literal[1459585352]`
+ rotkehlchen/tests/external_apis/test_xratescom.py:39:9: error[invalid-argument-type] Argument to function `get_historical_xratescom_exchange_rates` is incorrect: Expected `Timestamp`, found `Literal[1459585352]`
+ rotkehlchen/tests/external_apis/test_xratescom.py:52:13: error[invalid-argument-type] Argument to function `get_historical_xratescom_exchange_rates` is incorrect: Expected `Timestamp`, found `Literal[512814152]`
+ rotkehlchen/tests/fixtures/exchanges/bitmex.py:28:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiKey`, found `Literal["XY98JYVL15Zn-iU9f7OsJeVf"]`
+ rotkehlchen/tests/fixtures/exchanges/bitmex.py:29:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ApiSecret`, found `Literal[b"671tM6f64bt6KhteDakj2uCCNBt7HhZVEE7H5x16Oy4zb1ag"]`
+ rotkehlchen/tests/fixtures/exchanges/cryptocom.py:15:9: error[invalid-argument-type] Argument to function `create_test_cryptocom` is incorrect: Expected `ApiKey | None`, found `Literal["ddddddd"]`
+ rotkehlchen/tests/fixtures/exchanges/cryptocom.py:16:9: error[invalid-argument-type] Argument to function `create_test_cryptocom` is incorrect: Expected `ApiSecret | None`, found `Literal[b"secret"]`
- rotkehlchen/tests/integration/test_blockchain.py:40:9: error[invalid-argument-type] Argument to function `mock_etherscan_query` is incorrect: Expected `dict[@Todo, dict[str | EvmToken, Any]]`, found `dict[Unknown, Unknown | dict[Unknown | Asset, Unknown | int]]`
+ rotkehlchen/tests/integration/test_blockchain.py:40:9: error[invalid-argument-type] Argument to function `mock_etherscan_query` is incorrect: Expected `dict[ChecksumAddress, dict[str | EvmToken, Any]]`, found `dict[Unknown | ChecksumAddress, Unknown | dict[Unknown | Asset, Unknown | int]]`
+ rotkehlchen/tests/integration/test_zksynclite.py:55:9: error[invalid-argument-type] Argument is incorrect: Expected `EVMTxHash`, found `Literal[b"\xb8\rF;\xbc\xf8J\x87m\xb6\xcf\x80_\x1d\x88k`\xe7\xab\r9!4\xb3t\xe2\xea\xb3\xa1\x93/\xe1"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:59:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:60:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x957A50DA7B25Ce98B7556AfEF1d4e5F5C60fC818"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:66:9: error[invalid-argument-type] Argument is incorrect: Expected `EVMTxHash`, found `Literal[b"1*\xb01\xb3PL\xde\xc45G\x95\x17l\xcc\xadL\xaf8\xa1P\xd5\xd3\x10\xc9^\x93I\x9bY\xee\xd1"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:70:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress`, found `Literal["0x9531C059098e3d194fF87FebB587aB07B30B1306"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:71:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:77:9: error[invalid-argument-type] Argument is incorrect: Expected `EVMTxHash`, found `Literal[b"\xe8wB<\xc4\xf2F\x13H\x96\xbfZf\xcc\x922\xa8\xbeM\xc7\x1au\xd7\xeap>\x10]\xfd\x8e{\x82"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:81:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress`, found `Literal["0x9531C059098e3d194fF87FebB587aB07B30B1306"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:82:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:94:9: error[invalid-argument-type] Argument is incorrect: Expected `EVMTxHash`, found `Literal[b'\xe8"\x81\xa8\\"\xc7r\xeb5\x17p5\xd9<\xdb\x7fU\x9b\xafp\xe0,\t\x00\xf5\x08\xe7#=\x1d\x0f']`
+ rotkehlchen/tests/integration/test_zksynclite.py:98:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:99:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x4D9339dd97db55e3B9bCBE65dE39fF9c04d1C2cd"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:111:9: error[invalid-argument-type] Argument is incorrect: Expected `EVMTxHash`, found `Literal[b"\x83\x00\x1f\x1cU\x80\xd9\r4Wy\xcd\x10v/\xc7\x1cL\x90  %Q\xbcH\x031\xd7\rT|\xc7"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:115:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:122:9: error[invalid-argument-type] Argument is incorrect: Expected `EVMTxHash`, found `Literal[b"3\x1f\xccI\xdc<\nw.\x0b^E\x185\x0f=\x9a\\Uv\xb4\xe8\xdb\xc7\xc5k,Y\xca\xa29\xbb"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:126:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress`, found `Literal["0x9531C059098e3d194fF87FebB587aB07B30B1306"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:127:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:133:9: error[invalid-argument-type] Argument is incorrect: Expected `EVMTxHash`, found `Literal[b"\xbdr;Z_\x87\xe4\x85\xa4x\xbc}\x1f6]\xb7\x94@\xb6\xe90[\xff;\x16\xa0\xe0\xab\x83\xe5\x19p"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:137:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/integration/test_zksynclite.py:138:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x2B888954421b424C5D3D9Ce9bB67c9bD47537d12"]`
+ rotkehlchen/tests/unit/accounting/evm/test_transactions.py:32:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Timestamp`
+ rotkehlchen/tests/unit/accounting/test_basic.py:63:44: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1436979735]`
+ rotkehlchen/tests/unit/accounting/test_basic.py:63:56: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1495751688]`
+ rotkehlchen/tests/unit/accounting/test_exchanges.py:49:77: error[invalid-argument-type] Argument to function `accounting_create_and_process_history` is incorrect: Expected `Timestamp`, found `Literal[0]`
+ rotkehlchen/tests/unit/accounting/test_exchanges.py:49:89: error[invalid-argument-type] Argument to function `accounting_create_and_process_history` is incorrect: Expected `Timestamp`, found `Literal[1611426233]`
+ rotkehlchen/tests/unit/accounting/test_prefork_assets.py:52:44: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1436979735]`
+ rotkehlchen/tests/unit/accounting/test_prefork_assets.py:52:56: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1495751688]`
+ rotkehlchen/tests/unit/accounting/test_prefork_assets.py:105:44: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1436979735]`
+ rotkehlchen/tests/unit/accounting/test_prefork_assets.py:105:56: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1519693374]`
+ rotkehlchen/tests/unit/accounting/test_prefork_assets.py:183:44: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1436979735]`
+ rotkehlchen/tests/unit/accounting/test_prefork_assets.py:183:56: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1569693374]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:56:44: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1436979735]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:56:56: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1519693374]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:71:44: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1436979735]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:71:56: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1519693374]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:86:44: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1436979735]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:86:56: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1519693374]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:123:44: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1436979735]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:123:65: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1619693374]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:153:44: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1436979735]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:153:56: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1519693374]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:182:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp | None`, found `Literal[1484438400]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:183:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1484629704]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:192:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp | None`, found `Literal[1487116800]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:193:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1487289600]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:204:9: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1436979735]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:205:9: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1519693374]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:263:9: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1466979735]`
+ rotkehlchen/tests/unit/accounting/test_settings.py:264:9: error[invalid-argument-type] Argument to function `accounting_history_process` is incorrect: Expected `Timestamp`, found `Literal[1519693374]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:207:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[1605789951000]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:219:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[1605789951000]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:232:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[1605789951000]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:245:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[1605789951000]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:271:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:314:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:328:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:356:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:399:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:413:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:441:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:504:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:518:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:533:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:690:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:752:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:766:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aave_v2.py:781:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_aerodrome.py:248:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x2223F9FE624F69Da4D8256A7bCc9104FBA7F8f75"]`
+ rotkehlchen/tests/unit/decoders/test_aerodrome.py:261:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x2223F9FE624F69Da4D8256A7bCc9104FBA7F8f75"]`
+ rotkehlchen/tests/unit/decoders/test_aerodrome.py:274:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x2223F9FE624F69Da4D8256A7bCc9104FBA7F8f75"]`
+ rotkehlchen/tests/unit/decoders/test_arbitrum_one_bridge.py:271:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x6D2457a4ad276000A615295f7A80F79E48CcD318"]`
+ rotkehlchen/tests/unit/decoders/test_convex.py:166:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[1655675488]`
+ rotkehlchen/tests/unit/decoders/test_convex.py:412:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_convex.py:474:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_convex.py:488:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_convex.py:503:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TimestampMS`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_convex.py:526:9: error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Literal[0]`
+ rotkehlchen/tests/unit/decoders/test_convex.py:528:9: error[invalid-argument-type] Argument is incorrect: Expected `ChecksumAddress`, found `Literal["0x95c5582D781d507A084c9E5f885C77BabACf8EeA"]`
+ rotkehlchen/tests/unit/decoders/test_convex.py:615:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Timesta...*[Comment body truncated]*

@oconnor663
Copy link
Contributor Author

oconnor663 commented Nov 1, 2025

Relevant to the error formatting tweak I just pushed in daeb800, do we like the example in that commit message:

from typing import NewType
from nonexistent_module import Foo
Bar = NewType("Bar", Foo)
error[invalid-newtype]: invalid base for `typing.NewType`
 --> test.py:3:22
  |
1 | from typing import NewType
2 | from nonexistent_module import Foo
3 | Bar = NewType("Bar", Foo)
  |                      ^^^ type `Unknown`
info: The base of a `NewType` must be a class type or another `NewType`.
info: rule `invalid-newtype` is enabled by default

That's a result of the check that says a NewType base should be either a class type or another newtype. Unknown is neither of those things. Is this error what we expect? Will this sort of thing by noisy around unresolved imports? (I haven't played much with how those work yet.)

@AlexWaygood
Copy link
Member

AlexWaygood commented Nov 2, 2025

Diagnostic diff on typing conformance tests

Nice, these changes all look like true positives -- places where we should have been emitting diagnostics, but we previously weren't!

@AlexWaygood
Copy link
Member

That's a result of the check that says a NewType base should be either a class type or another newtype. Unknown is neither of those things. Is this error what we expect? Will this sort of thing by noisy around unresolved imports? (I haven't played much with how those work yet.)

I think it would be good to suppress the diagnostic here if the second argument has a dynamic type. The user will get a diagnostic from the unresolved import in your example; there's not much use in having cascading diagnostics later on in the module due to the same issue.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Here's my full review. Overall this looks excellent!! This definitely looks like right overall approach IMO.

My main feedback is that it would be great to have some more tests for various parts of the behaviour that you're implementing here. I left some comments inline about things that look correct, but that it would be great to explicitly test. It might also be worth looking through the typing conformance-suite tests for newtype, and/or mypy's tests for newtype, to see if there are any other things that would be worth testing for explicitly.

Comment on lines +5227 to +5292
Some(KnownClass::NewType) => {
Binding::single(
self,
Signature::new(
Parameters::new([
Parameter::positional_or_keyword(Name::new_static("name"))
.with_annotated_type(Type::LiteralString),
Parameter::positional_or_keyword(Name::new_static("tp")),
]),
// The actual return type is a KnownInstanceType::NewType(_), but each
// callsite gets a unique payload, including a `Definition` that points
// to that callsite. See `struct NewType` and `infer_newtype_expression`.
None,
),
)
.into()
}
Copy link
Member

Choose a reason for hiding this comment

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

one issue here is that on Python 3.9, NewType is a function rather than a class. I don't know if this really matters this much TBH, since Python 3.9 is now end-of-life, and supporting both the pre-3.9 version of NewType (where it was a function) and the 3.10-version of NewType (where it's a class) is going to lead to complications for us.

At the very least, it might be good to add an mdtest with python-version = "3.9" so that we document that we don't support NewType on Python <=3.9 currently. But I would certainly be inclined to leave <=3.9 support out of the first PR adding support for NewType.

Copy link
Contributor Author

@oconnor663 oconnor663 Nov 5, 2025

Choose a reason for hiding this comment

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

What's your recommendation for this diagnostic? It doesn't look like I have an InferContext at this point to directly emit something. Is there a type that I can return that indirectly forces a diagnostic? (edit: ah you're not asking for a diagnostic)

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Looking really good -- a couple more small comments!

.and_then(|cls| cls.known(self.db()));
if let Some(KnownClass::NewType) = known_class {
self.infer_newtype_assignment_deferred(arguments);
return;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just pushed a big rebase (addressing most of @AlexWaygood's comments, but now I see there are more :-D ), and this part ended up being tricky. It looks like if I don't short-circuit here, I run into a panic about inferring the same expression (the second arg) twice. Please let me know if this looks like the right way to avoid that, and whether it's maybe worthy of a block comment saying why this is sensitive?

@oconnor663 oconnor663 marked this pull request as ready for review November 6, 2025 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ecosystem-analyzer ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants