python-benedict icon indicating copy to clipboard operation
python-benedict copied to clipboard

Add type hints

Open Tatsh opened this issue 7 months ago • 6 comments


name: Pull request about: Submit a pull request for this project assignees: fabiocaccamo


Describe your changes Add type hints.

Notes:

  • Improvements can certainly come after 3.13 is the oldest version of Python supported. For now a lot of things have to return Any.
  • The _KPT type used in __init__.py is less than ideal but it covers all bases of what is possible to use for a key, but there are still some functions that extend from Keyattr and those must take _K which defaults to str.
  • typing.cast() is used instead of type assertions to avoid the error from Codacy (which has the Bandit rule about assertions). Overhead is likely minimal vs assert calls but the nice thing is they do get removed in optimised mode, so the overhead can be zero in that case. I see no real issue with assertions so if you want to use those instead of cast() I can revise this. I think making a Bandit config file can quiet Codacy about the issue.

I have tried this with my youtube-unofficial project and it works as expected.

The best way to use this is with typing is to add the type on assignment:

bd = benedict({'a': {'b': 1, 'c': 2}})
b: int = bd['a.b]
c: int = bd[('a', 'c')]

In the future the way to solve this is to have a TypeBenedict to specify a schema, and then have a Mypy plugin that would resolve the actual type. This is similar to what the Mypy Django plugin does with database models.

Related issue Issue #157

Checklist before requesting a review

  • [x] I have performed a self-review of my code.
  • [x] I have added tests for the proposed changes.
  • [x] I have run the tests and there are not errors.

Tatsh avatar Apr 29 '25 04:04 Tatsh

There is still a bit left to do (started with about 1700 issues, now down to 388):

benedict/dicts/base/base_dict.py:48:20: error: Unsupported right operand type for in ("dict[_K, _V] | None")  [operator]
benedict/dicts/base/base_dict.py:54:17: error: Invalid index type "str" for "Self"; expected type "_K"  [index]
benedict/dicts/base/base_dict.py:59:13: error: Item "None" of "dict[_K, _V] | None" has no attribute "__delitem__"  [union-attr]
benedict/dicts/base/base_dict.py:70:20: error: Value of type "dict[_K, _V] | None" is not indexable  [index]
benedict/dicts/base/base_dict.py:73:6: error: Signature of "__ior__" incompatible with supertype "dict"  [override]
benedict/dicts/base/base_dict.py:73:6: note:      Superclass:
benedict/dicts/base/base_dict.py:73:6: note:          @overload
benedict/dicts/base/base_dict.py:73:6: note:          def __ior__(self, SupportsKeysAndGetItem[_K, _V], /) -> BaseDict[_K, _V]
benedict/dicts/base/base_dict.py:73:6: note:          @overload
benedict/dicts/base/base_dict.py:73:6: note:          def __ior__(self, Iterable[tuple[_K, _V]], /) -> BaseDict[_K, _V]
benedict/dicts/base/base_dict.py:73:6: note:      Subclass:
benedict/dicts/base/base_dict.py:73:6: note:          @overload
benedict/dicts/base/base_dict.py:73:6: note:          def __ior__(self, SupportsKeysAndGetItem[str, _V], /) -> BaseDict[_K, _V]
benedict/dicts/base/base_dict.py:73:6: note:          @overload
benedict/dicts/base/base_dict.py:73:6: note:          def __ior__(self, Iterable[tuple[str, _V]], /) -> BaseDict[_K, _V]
benedict/dicts/base/base_dict.py:73:6: error: Signature of "__ior__" incompatible with "__or__" of supertype "dict"  [override]
benedict/dicts/base/base_dict.py:73:6: note:      Superclass:
benedict/dicts/base/base_dict.py:73:6: note:          @overload
benedict/dicts/base/base_dict.py:73:6: note:          def __or__(self, dict[_K, _V], /) -> dict[_K, _V]
benedict/dicts/base/base_dict.py:73:6: note:          @overload
benedict/dicts/base/base_dict.py:73:6: note:          def [_T1, _T2] __or__(self, dict[_T1, _T2], /) -> dict[_K | _T1, _V | _T2]
benedict/dicts/base/base_dict.py:73:6: note:      Subclass:
benedict/dicts/base/base_dict.py:73:6: note:          @overload
benedict/dicts/base/base_dict.py:73:6: note:          def __ior__(self, SupportsKeysAndGetItem[str, _V], /) -> BaseDict[_K, _V]
benedict/dicts/base/base_dict.py:73:6: note:          @overload
benedict/dicts/base/base_dict.py:73:6: note:          def __ior__(self, Iterable[tuple[str, _V]], /) -> BaseDict[_K, _V]
benedict/dicts/base/base_dict.py:73:6: error: Signatures of "__ior__" and "__or__" are incompatible  [misc]
benedict/dicts/base/base_dict.py:77:5: error: Signatures of "__ior__" and "__or__" are incompatible  [misc]
benedict/dicts/base/base_dict.py:81:20: error: Item "None" of "dict[_K, _V] | None" has no attribute "__ior__"  [union-attr]
benedict/dicts/base/base_dict.py:81:20: error: Incompatible return value type (got "dict[_K, _V] | Any", expected "Self | UserDict[str | _T1, _V | _T2]")  [return-value]
benedict/dicts/base/base_dict.py:81:39: error: Argument 1 to "__ior__" of "dict" has incompatible type "useful_types.SupportsKeysAndGetItem[str, _V] | Iterable[tuple[str, _V]]"; expected "_typeshed.SupportsKeysAndGetItem[_K, _V]"  [arg-type]
benedict/dicts/base/base_dict.py:82:32: error: Argument 1 to "__ior__" of "dict" has incompatible type "useful_types.SupportsKeysAndGetItem[str, _V] | Iterable[tuple[str, _V]]"; expected "_typeshed.SupportsKeysAndGetItem[_K, _V]"  [arg-type]
benedict/dicts/base/base_dict.py:84:5: error: Return type "Iterator[str]" of "__iter__" incompatible with return type "Iterator[_K]" in supertype "dict"  [override]
benedict/dicts/base/base_dict.py:84:5: error: Return type "Iterator[str]" of "__iter__" incompatible with return type "Iterator[_K]" in supertype "Iterable"  [override]
benedict/dicts/base/base_dict.py:86:25: error: Argument 1 to "iter" has incompatible type "dict[_K, _V] | None"; expected "SupportsIter[Iterator[str]]"  [arg-type]
benedict/dicts/base/base_dict.py:87:16: error: Incompatible return value type (got "Iterator[_K]", expected "Iterator[str]")  [return-value]
benedict/dicts/base/base_dict.py:91:24: error: Argument 1 to "len" has incompatible type "dict[_K, _V] | None"; expected "Sized"  [arg-type]
benedict/dicts/base/base_dict.py:94:6: error: Signature of "__or__" incompatible with supertype "dict"  [override]
benedict/dicts/base/base_dict.py:94:6: note:      Superclass:
benedict/dicts/base/base_dict.py:94:6: note:          @overload
benedict/dicts/base/base_dict.py:94:6: note:          def __or__(self, dict[_K, _V], /) -> dict[_K, _V]
benedict/dicts/base/base_dict.py:94:6: note:          @overload
benedict/dicts/base/base_dict.py:94:6: note:          def [_T1, _T2] __or__(self, dict[_T1, _T2], /) -> dict[_K | _T1, _V | _T2]
benedict/dicts/base/base_dict.py:94:6: note:      Subclass:
benedict/dicts/base/base_dict.py:94:6: note:          @overload
benedict/dicts/base/base_dict.py:94:6: note:          def __or__(self, UserDict[str, _V] | dict[str, _V], /) -> BaseDict[_K, _V]
benedict/dicts/base/base_dict.py:94:6: note:          @overload
benedict/dicts/base/base_dict.py:94:6: note:          def [_T1, _T2] __or__(self, UserDict[_T1, _T2] | dict[_T1, _T2], /) -> UserDict[str | _T1, _V | _T2]
benedict/dicts/base/base_dict.py:95:5: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
benedict/dicts/base/base_dict.py:95:5: note: Flipping the order of overloads will fix this error
benedict/dicts/base/base_dict.py:100: error: Unused "type: ignore" comment  [unused-ignore]
benedict/dicts/base/base_dict.py:105:20: error: Unsupported left operand type for | (some union)  [operator]
benedict/dicts/base/base_dict.py:105:20: error: Incompatible return value type (got "dict[_K, _V] | Any", expected "Self | UserDict[str | _T1, _V | _T2]")  [return-value]
benedict/dicts/base/base_dict.py:105:38: error: Unsupported operand types for | ("dict[_K, _V]" and "UserDict[str, _V] | dict[str, _V] | UserDict[_T1, _T2] | dict[_T1, _T2]")  [operator]
benedict/dicts/base/base_dict.py:106:16: error: Incompatible return value type (got "dict[_K, _V]", expected "Self | UserDict[str | _T1, _V | _T2]")  [return-value]
benedict/dicts/base/base_dict.py:106:31: error: Unsupported operand types for | ("Self" and "UserDict[str, _V] | dict[str, _V] | UserDict[_T1, _T2] | dict[_T1, _T2]")  [operator]
benedict/dicts/base/base_dict.py:116:28: error: Unsupported right operand type for in ("dict[_K, _V] | None")  [operator]
benedict/dicts/base/base_dict.py:116:61: error: Value of type "dict[_K, _V] | None" is not indexable  [index]
benedict/dicts/base/base_dict.py:119:20: error: Value of type "dict[_K, _V] | None" is not indexable  [index]
benedict/dicts/base/base_dict.py:122:17: error: Value of type "dict[_K, _V] | None" is not indexable  [index]
benedict/dicts/base/base_dict.py:122:17: error: Item "object" of "_V | Any" has no attribute "clear"  [union-attr]
benedict/dicts/base/base_dict.py:123:17: error: Value of type "dict[_K, _V] | None" is not indexable  [index]
benedict/dicts/base/base_dict.py:123:17: error: Item "object" of "_V | Any" has no attribute "update"  [union-attr]
benedict/dicts/base/base_dict.py:125:13: error: Unsupported target for indexed assignment ("dict[_K, _V] | None")  [index]
benedict/dicts/base/base_dict.py:140:13: error: Item "None" of "dict[_K, _V] | None" has no attribute "clear"  [union-attr]
benedict/dicts/base/base_dict.py:146:20: error: Item "None" of "dict[_K, _V] | None" has no attribute "copy"  [union-attr]
benedict/dicts/base/base_dict.py:146:20: error: Incompatible return value type (got "dict[_K, _V] | Any", expected "Self")  [return-value]
benedict/dicts/base/base_dict.py:147:16: error: Incompatible return value type (got "dict[_K, _V]", expected "Self")  [return-value]
benedict/dicts/base/base_dict.py:151:20: error: Incompatible return value type (got "dict[_K, _V] | None", expected "Self")  [return-value]
benedict/dicts/base/base_dict.py:154:5: error: Signature of "get" incompatible with supertype "dict"  [override]
benedict/dicts/base/base_dict.py:154:5: note:      Superclass:
benedict/dicts/base/base_dict.py:154:5: note:          @overload
benedict/dicts/base/base_dict.py:154:5: note:          def get(self, _K, /) -> _V | None
benedict/dicts/base/base_dict.py:154:5: note:          @overload
benedict/dicts/base/base_dict.py:154:5: note:          def get(self, _K, _V, /) -> _V
benedict/dicts/base/base_dict.py:154:5: note:          @overload
benedict/dicts/base/base_dict.py:154:5: note:          def [_T] get(self, _K, _T, /) -> _V | _T
benedict/dicts/base/base_dict.py:154:5: note:      Subclass:
benedict/dicts/base/base_dict.py:154:5: note:          def get(self, key: _K, default: _V | None = ...) -> _V | None
benedict/dicts/base/base_dict.py:154:5: error: Signature of "get" incompatible with supertype "Mapping"  [override]
benedict/dicts/base/base_dict.py:154:5: note:      Superclass:
benedict/dicts/base/base_dict.py:154:5: note:          @overload
benedict/dicts/base/base_dict.py:154:5: note:          def get(self, _K, /) -> _V | None
benedict/dicts/base/base_dict.py:154:5: note:          @overload
benedict/dicts/base/base_dict.py:154:5: note:          def [_T] get(self, _K, /, default: _V | _T) -> _V | _T
benedict/dicts/base/base_dict.py:154:5: note:      Subclass:
benedict/dicts/base/base_dict.py:154:5: note:          def get(self, key: _K, default: _V | None = ...) -> _V | None
benedict/dicts/base/base_dict.py:160:5: error: Return type "ItemsView[str, _V]" of "items" incompatible with return type "dict_items[_K, _V]" in supertype "dict"  [override]
benedict/dicts/base/base_dict.py:160:5: error: Return type "ItemsView[str, _V]" of "items" incompatible with return type "ItemsView[_K, _V]" in supertype "Mapping"  [override]
benedict/dicts/base/base_dict.py:162:20: error: Item "None" of "dict[_K, _V] | None" has no attribute "items"  [union-attr]
benedict/dicts/base/base_dict.py:162:20: error: Incompatible return value type (got "dict_items[_K, _V] | Any", expected "ItemsView[str, _V]")  [return-value]
benedict/dicts/base/base_dict.py:163:16: error: Incompatible return value type (got "dict_items[_K, _V]", expected "ItemsView[str, _V]")  [return-value]
benedict/dicts/base/base_dict.py:165:5: error: Return type "KeysView[str]" of "keys" incompatible with return type "dict_keys[_K, _V]" in supertype "dict"  [override]
benedict/dicts/base/base_dict.py:165:5: error: Return type "KeysView[str]" of "keys" incompatible with return type "KeysView[_K]" in supertype "Mapping"  [override]
benedict/dicts/base/base_dict.py:167:20: error: Item "None" of "dict[_K, _V] | None" has no attribute "keys"  [union-attr]
benedict/dicts/base/base_dict.py:167:20: error: Incompatible return value type (got "dict_keys[_K, _V] | Any", expected "KeysView[str]")  [return-value]
benedict/dicts/base/base_dict.py:168:16: error: Incompatible return value type (got "dict_keys[_K, _V]", expected "KeysView[str]")  [return-value]
benedict/dicts/base/base_dict.py:184:5: error: Signature of "update" incompatible with supertype "MutableMapping"  [override]
benedict/dicts/base/base_dict.py:184:5: note:      Superclass:
benedict/dicts/base/base_dict.py:184:5: note:          @overload
benedict/dicts/base/base_dict.py:184:5: note:          def update(self, SupportsKeysAndGetItem[_K, _V], /, **kwargs: _V) -> None
benedict/dicts/base/base_dict.py:184:5: note:          @overload
benedict/dicts/base/base_dict.py:184:5: note:          def update(self, Iterable[tuple[_K, _V]], /, **kwargs: _V) -> None
benedict/dicts/base/base_dict.py:184:5: note:          @overload
benedict/dicts/base/base_dict.py:184:5: note:          def update(self, **kwargs: _V) -> None
benedict/dicts/base/base_dict.py:184:5: note:      Subclass:
benedict/dicts/base/base_dict.py:184:5: note:          def update(self, other: object) -> None
benedict/dicts/base/base_dict.py:187:13: error: Item "None" of "dict[_K, _V] | None" has no attribute "update"  [union-attr]
benedict/dicts/base/base_dict.py:187:13: error: No overload variant of "update" of "MutableMapping" matches argument type "object"  [call-overload]
benedict/dicts/base/base_dict.py:187:13: note: Possible overload variants:
benedict/dicts/base/base_dict.py:187:13: note:     def update(self, SupportsKeysAndGetItem[_K, _V], /, **kwargs: _V) -> None
benedict/dicts/base/base_dict.py:187:13: note:     def update(self, Iterable[tuple[_K, _V]], /, **kwargs: _V) -> None
benedict/dicts/base/base_dict.py:187:13: note:     def update(self, **kwargs: _V) -> None
benedict/dicts/base/base_dict.py:189:9: error: No overload variant of "update" of "MutableMapping" matches argument type "object"  [call-overload]
benedict/dicts/base/base_dict.py:189:9: note: Possible overload variants:
benedict/dicts/base/base_dict.py:189:9: note:     def update(self, SupportsKeysAndGetItem[_K, _V], /, **kwargs: _V) -> None
benedict/dicts/base/base_dict.py:189:9: note:     def update(self, Iterable[tuple[_K, _V]], /, **kwargs: _V) -> None
benedict/dicts/base/base_dict.py:189:9: note:     def update(self, **kwargs: _V) -> None
benedict/dicts/base/base_dict.py:191:5: error: Return type "ValuesView[_V]" of "values" incompatible with return type "dict_values[_K, _V]" in supertype "dict"  [override]
benedict/dicts/keylist/keylist_dict.py:38:54: error: Argument 2 to "get_item" has incompatible type "dict[str, Any] | list[Any] | tuple[Any, ...]"; expected "Sequence[Any]"  [arg-type]
benedict/dicts/keylist/keylist_dict.py:44:13: error: Statement is unreachable  [unreachable]
benedict/dicts/keylist/keylist_dict.py:55:13: error: Returning Any from function declared to return "_V"  [no-any-return]
benedict/dicts/keylist/keylist_dict.py:70:28: error: Argument 1 to "get" of "BaseDict" has incompatible type "_K | Sequence[str]"; expected "_K"  [arg-type]
benedict/dicts/keylist/keylist_dict.py:70:33: error: Argument 2 to "get" of "BaseDict" has incompatible type "_T | _V | None"; expected "_V | None"  [arg-type]
benedict/dicts/keylist/keylist_dict.py:77:13: error: Returning Any from function declared to return "_T | _V | None"  [no-any-return]
benedict/dicts/keylist/keylist_dict.py:79:13: error: Statement is unreachable  [unreachable]
benedict/dicts/keylist/keylist_dict.py:82:5: error: Function is missing a return type annotation  [no-untyped-def]
benedict/dicts/keylist/keylist_dict.py:82:5: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
benedict/dicts/keylist/keylist_dict.py:87:5: error: Function is missing a return type annotation  [no-untyped-def]
benedict/dicts/keylist/keylist_dict.py:87:5: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
benedict/dicts/keylist/keylist_dict.py:92:13: error: Statement is unreachable  [unreachable]
benedict/dicts/keylist/keylist_dict.py:95:13: error: Statement is unreachable  [unreachable]
benedict/dicts/keylist/keylist_dict.py:103:5: error: Return type "_V | None" of "setdefault" incompatible with return type "_V" in supertype "BaseDict"  [override]
benedict/dicts/keylist/keylist_dict.py:103:5: error: Signature of "setdefault" incompatible with supertype "MutableMapping"  [override]
benedict/dicts/keylist/keylist_dict.py:103:5: note:      Superclass:
benedict/dicts/keylist/keylist_dict.py:103:5: note:          @overload
benedict/dicts/keylist/keylist_dict.py:103:5: note:          def setdefault(self, _K, _V, /) -> _V
benedict/dicts/keylist/keylist_dict.py:103:5: note:      Subclass:
benedict/dicts/keylist/keylist_dict.py:103:5: note:          def setdefault(self, key: _K, default: _V | None = ...) -> _V | None
benedict/dicts/keylist/keylist_dict.py:105:25: error: Incompatible types in assignment (expression has type "_V | None", target has type "_V")  [assignment]
benedict/core/standardize.py:20:17: error: Argument 2 to "traverse" has incompatible type "Callable[[MutableMapping[Any, Any], Any, Any], None]"; expected "Callable[[Mapping[Any, Any] | Sequence[Any] | None, Any | int, Any | None], None]"  [arg-type]
benedict/core/match.py:10: error: Missing type parameters for generic type "Pattern"  [type-arg]
benedict/dicts/parse/parse_dict.py:102:37: error: Argument 2 to "_get_value" of "ParseDict" has incompatible type "bool"; expected "_V"  [arg-type]
benedict/dicts/parse/parse_dict.py:102:47: error: List item 0 has incompatible type "bool"; expected "_V"  [list-item]
benedict/dicts/parse/parse_dict.py:102:53: error: List item 1 has incompatible type "bool"; expected "_V"  [list-item]
benedict/dicts/parse/parse_dict.py:105:46: error: Incompatible default for argument "default" (default has type "None", argument has type "list[bool]")  [assignment]
benedict/dicts/parse/parse_dict.py:105:46: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
benedict/dicts/parse/parse_dict.py:105:46: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
benedict/dicts/parse/parse_dict.py:118:35: error: Incompatible default for argument "choices" (default has type "None", argument has type "Sequence[date]")  [assignment]
benedict/dicts/parse/parse_dict.py:118:35: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
benedict/dicts/parse/parse_dict.py:118:35: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
benedict/dicts/parse/parse_dict.py:125:16: error: Incompatible return value type (got "bool", expected "date | None")  [return-value]
benedict/dicts/parse/parse_dict.py:126:18: error: Argument 2 to "_get_value" of "ParseDict" has incompatible type "date | None"; expected "_V"  [arg-type]
benedict/dicts/parse/parse_dict.py:126:27: error: Argument 3 to "_get_value" of "ParseDict" has incompatible type "Sequence[date]"; expected "Sequence[_V]"  [arg-type]
benedict/dicts/parse/parse_dict.py:126:36: error: Argument 4 to "_get_value" of "ParseDict" has incompatible type "Callable[[str | datetime, str | None], date | None]"; expected "Callable[[Any], bool | None]"  [arg-type]
benedict/dicts/parse/parse_dict.py:129:5: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
benedict/dicts/parse/parse_dict.py:145:39: error: Incompatible default for argument "choices" (default has type "None", argument has type "Sequence[datetime]")  [assignment]
benedict/dicts/parse/parse_dict.py:145:39: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
benedict/dicts/parse/parse_dict.py:145:39: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
benedict/dicts/parse/parse_dict.py:152:16: error: Incompatible return value type (got "bool", expected "datetime | None")  [return-value]
benedict/dicts/parse/parse_dict.py:153:18: error: Argument 2 to "_get_value" of "ParseDict" has incompatible type "datetime | None"; expected "_V"  [arg-type]
benedict/dicts/parse/parse_dict.py:153:27: error: Argument 3 to "_get_value" of "ParseDict" has incompatible type "Sequence[datetime]"; expected "Sequence[_V]"  [arg-type]
benedict/dicts/parse/parse_dict.py:153:36: error: Argument 4 to "_get_value" of "ParseDict" has incompatible type "Callable[[str | datetime, str | None], datetime | None]"; expected "Callable[[Any], bool | None]"  [arg-type]
benedict/dicts/parse/parse_dict.py:175:38: error: Incompatible default for argument "choices" (default has type "None", argument has type "Sequence[Decimal]")  [assignment]
benedict/dicts/parse/parse_dict.py:175:38: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
benedict/dicts/parse/parse_dict.py:175:38: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
benedict/dicts/parse/parse_dict.py:181:16: error: Incompatible return value type (got "bool", expected "Decimal | None")  [return-value]
benedict/dicts/parse/parse_dict.py:181:32: error: Argument 1 to "_get_value" of "ParseDict" has incompatible type "_V"; expected "_K"  [arg-type]
benedict/dicts/parse/parse_dict.py:181:37: error: Argument 2 to "_get_value" of "ParseDict" has incompatible type "Decimal | None"; expected "_V"  [arg-type]
benedict/dicts/parse/parse_dict.py:181:46: error: Argument 3 to "_get_value" of "ParseDict" has incompatible type "Sequence[Decimal]"; expected "Sequence[_V]"  [arg-type]
benedict/dicts/parse/parse_dict.py:181:55: error: Argument 4 to "_get_value" of "ParseDict" has incompatible type "Callable[[str], Decimal | None]"; expected "Callable[[Any], bool | None]"  [arg-type]
benedict/dicts/parse/parse_dict.py:190:38: error: Argument 1 to "_get_values_list" of "ParseDict" has incompatible type "_V"; expected "_K"  [arg-type]
benedict/dicts/parse/parse_dict.py:192:5: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
benedict/dicts/parse/parse_dict.py:197:9: error: Returning Any from function declared to return "Self"  [no-any-return]
benedict/dicts/parse/parse_dict.py:197:16: error: No overload variant of "_get_value" of "ParseDict" matches argument types "Any", "Mapping[str, Any]", "None", "Callable[[str | dict[str, Any]], dict[Any, Any] | None]"  [call-overload]
benedict/dicts/parse/parse_dict.py:197:16: note: Possible overload variants:
benedict/dicts/parse/parse_dict.py:197:16: note:     def _get_value(self, key: _K, default: _V, choices: Sequence[_V], parser_func: Callable[[Any], bool | None], parserstrwargs: Any = ...) -> bool
benedict/dicts/parse/parse_dict.py:197:16: note:     def _get_value(self, key: _K, default: _V, choices: Sequence[_V], parser_func: Callable[[str], Decimal | None], parserstrwargs: Any = ...) -> Decimal
benedict/dicts/parse/parse_dict.py:211:16: error: Incompatible return value type (got "bool", expected "str | None")  [return-value]
benedict/dicts/parse/parse_dict.py:213:13: error: Argument 2 to "_get_value" of "ParseDict" has incompatible type "str"; expected "_V"  [arg-type]
benedict/dicts/parse/parse_dict.py:214:13: error: Argument 3 to "_get_value" of "ParseDict" has incompatible type "Sequence[str] | None"; expected "Sequence[_V]"  [arg-type]
benedict/dicts/parse/parse_dict.py:215:13: error: Argument 4 to "_get_value" of "ParseDict" has incompatible type "Callable[[str, bool], str | None]"; expected "Callable[[Any], bool | None]"  [arg-type]
benedict/dicts/parse/parse_dict.py:226:16: error: Incompatible return value type (got "bool", expected "_V")  [return-value]
benedict/dicts/parse/parse_dict.py:226:37: error: Argument 2 to "_get_value" of "ParseDict" has incompatible type "float"; expected "_V"  [arg-type]
benedict/dicts/parse/parse_dict.py:226:46: error: Argument 3 to "_get_value" of "ParseDict" has incompatible type "Sequence[_V] | None"; expected "Sequence[_V]"  [arg-type]
benedict/dicts/parse/parse_dict.py:226:55: error: Argument 4 to "_get_value" of "ParseDict" has incompatible type "Callable[[str], float | None]"; expected "Callable[[Any], bool | None]"  [arg-type]
benedict/dicts/parse/parse_dict.py:237:75: error: Incompatible default for argument "choices" (default has type "None", argument has type "Sequence[int]")  [assignment]
benedict/dicts/parse/parse_dict.py:237:75: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
benedict/dicts/parse/parse_dict.py:237:75: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
benedict/dicts/parse/parse_dict.py:242:37: error: Argument 2 to "_get_value" of "ParseDict" has incompatible type "int"; expected "_V"  [arg-type]
benedict/dicts/parse/parse_dict.py:242:46: error: Argument 3 to "_get_value" of "ParseDict" has incompatible type "Sequence[int]"; expected "Sequence[_V]"  [arg-type]
benedict/dicts/parse/parse_dict.py:242:55: error: Argument 4 to "_get_value" of "ParseDict" has incompatible type "Callable[[int | str], int | None]"; expected "Callable[[Any], bool | None]"  [arg-type]
benedict/dicts/parse/parse_dict.py:263:9: error: Returning Any from function declared to return "list[Any]"  [no-any-return]
benedict/dicts/parse/parse_dict.py:263:16: error: No overload variant of "_get_value" of "ParseDict" matches argument types "_K", "Sequence[Any]", "None", "Callable[[str | tuple[Any, ...] | list[Any], str | None], list[Any] | None]", "dict[str, str | None]"  [call-overload]
benedict/dicts/parse/parse_dict.py:263:16: note: Possible overload variants:
benedict/dicts/parse/parse_dict.py:263:16: note:     def _get_value(self, key: _K, default: _V, choices: Sequence[_V], parser_func: Callable[[Any], bool | None], parserstrwargs: Any = ...) -> bool
benedict/dicts/parse/parse_dict.py:263:16: note:     def _get_value(self, key: _K, default: _V, choices: Sequence[_V], parser_func: Callable[[str], Decimal | None], parserstrwargs: Any = ...) -> Decimal
benedict/dicts/parse/parse_dict.py:296:9: error: Returning Any from function declared to return "dict[str, str] | None"  [no-any-return]
benedict/dicts/parse/parse_dict.py:296:16: error: No overload variant of "_get_value" of "ParseDict" matches argument types "_K", "dict[str, str]", "None", "Callable[[str, str | None], dict[str, str] | None]", "dict[str, str | None]"  [call-overload]
benedict/dicts/parse/parse_dict.py:296:16: note: Possible overload variants:
benedict/dicts/parse/parse_dict.py:296:16: note:     def _get_value(self, key: _K, default: _V, choices: Sequence[_V], parser_func: Callable[[Any], bool | None], parserstrwargs: Any = ...) -> bool
benedict/dicts/parse/parse_dict.py:296:16: note:     def _get_value(self, key: _K, default: _V, choices: Sequence[_V], parser_func: Callable[[str], Decimal | None], parserstrwargs: Any = ...) -> Decimal
benedict/dicts/parse/parse_dict.py:311:16: error: Incompatible return value type (got "bool", expected "str")  [return-value]
benedict/dicts/parse/parse_dict.py:311:37: error: Argument 2 to "_get_value" of "ParseDict" has incompatible type "str"; expected "_V"  [arg-type]
benedict/dicts/parse/parse_dict.py:311:46: error: Argument 3 to "_get_value" of "ParseDict" has incompatible type "Sequence[str] | None"; expected "Sequence[_V]"  [arg-type]
benedict/dicts/parse/parse_dict.py:311:55: error: Argument 4 to "_get_value" of "ParseDict" has incompatible type "Callable[[Any], str]"; expected "Callable[[Any], bool | None]"  [arg-type]
benedict/dicts/parse/parse_dict.py:322:76: error: Incompatible default for argument "choices" (default has type "None", argument has type "Sequence[str]")  [assignment]
benedict/dicts/parse/parse_dict.py:322:76: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
benedict/dicts/parse/parse_dict.py:322:76: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
benedict/dicts/parse/parse_dict.py:328:16: error: Incompatible return value type (got "bool", expected "str")  [return-value]
benedict/dicts/parse/parse_dict.py:328:37: error: Argument 2 to "_get_value" of "ParseDict" has incompatible type "str"; expected "_V"  [arg-type]
benedict/dicts/parse/parse_dict.py:328:46: error: Argument 3 to "_get_value" of "ParseDict" has incompatible type "Sequence[str]"; expected "Sequence[_V]"  [arg-type]
benedict/dicts/parse/parse_dict.py:328:55: error: Argument 4 to "_get_value" of "ParseDict" has incompatible type "Callable[[Any], str]"; expected "Callable[[Any], bool | None]"  [arg-type]
benedict/dicts/parse/parse_dict.py:340:68: error: Incompatible default for argument "choices" (default has type "None", argument has type "Sequence[str]")  [assignment]
benedict/dicts/parse/parse_dict.py:340:68: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
benedict/dicts/parse/parse_dict.py:340:68: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
benedict/dicts/parse/parse_dict.py:346:16: error: Incompatible return value type (got "bool", expected "str | None")  [return-value]
benedict/dicts/parse/parse_dict.py:346:37: error: Argument 2 to "_get_value" of "ParseDict" has incompatible type "str"; expected "_V"  [arg-type]
benedict/dicts/parse/parse_dict.py:346:46: error: Argument 3 to "_get_value" of "ParseDict" has incompatible type "Sequence[str]"; expected "Sequence[_V]"  [arg-type]
benedict/dicts/parse/parse_dict.py:346:55: error: Argument 4 to "_get_value" of "ParseDict" has incompatible type "Callable[[str], str | None]"; expected "Callable[[Any], bool | None]"  [arg-type]
benedict/dicts/parse/parse_dict.py:356:43: error: Bad number of arguments for type alias, expected 0, given 1  [type-arg]
tests/dicts/keylist/test_keylist_dict.py:15:25: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keylist/test_keylist_dict.py:16:26: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keylist/test_keylist_dict.py:25:26: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keylist/test_keylist_dict.py:26:25: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keylist/test_keylist_dict.py:39:28: error: Invalid index type "list[str]" for "KeylistDict[str, Any]"; expected type "str"  [index]
tests/dicts/keylist/test_keylist_dict.py:40:28: error: Invalid index type "list[str]" for "KeylistDict[str, Any]"; expected type "str"  [index]
tests/dicts/keylist/test_keylist_dict.py:49:26: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keylist/test_keylist_dict.py:50:25: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/core/test_search.py:52:17: error: Value of type "object" is not indexable  [index]
tests/core/test_search.py:54:17: error: Value of type "object" is not indexable  [index]
tests/core/test_search.py:80:13: error: Unsupported operand types for in ("tuple[object, str, Any]" and "list[tuple[Mapping[str, object] | Sequence[Any] | None, str | int, object]]")  [operator]
tests/core/test_search.py:83:17: error: Value of type "object" is not indexable  [index]
tests/core/test_search.py:89:17: error: Value of type "object" is not indexable  [index]
tests/core/test_search.py:91:17: error: Value of type "object" is not indexable  [index]
tests/core/test_search.py:97:17: error: Value of type "object" is not indexable  [index]
tests/core/test_search.py:99:17: error: Value of type "object" is not indexable  [index]
tests/core/test_search.py:118:17: error: Value of type "object" is not indexable  [index]
tests/core/test_search.py:120:17: error: Value of type "object" is not indexable  [index]
tests/core/test_search.py:167:17: error: Value of type "object" is not indexable  [index]
tests/core/test_search.py:196:17: error: Value of type "object" is not indexable  [index]
tests/core/test_search.py:225:17: error: Value of type "object" is not indexable  [index]
tests/core/test_nest.py:25:19: error: Argument 1 to "nest" has incompatible type "list[object]"; expected "Sequence[Mapping[str, Any]]"  [arg-type]
tests/core/test_nest.py:101:23: error: Argument 1 to "nest" has incompatible type "list[object]"; expected "Sequence[Mapping[str, Any]]"  [arg-type]
tests/core/test_nest.py:103:23: error: Argument 1 to "nest" has incompatible type "list[object]"; expected "Sequence[Mapping[str, Any]]"  [arg-type]
tests/core/test_nest.py:105:23: error: Argument 1 to "nest" has incompatible type "list[object]"; expected "Sequence[Mapping[str, Any]]"  [arg-type]
tests/core/test_nest.py:110:23: error: Argument 1 to "nest" has incompatible type "dict[str, str | int | None]"; expected "Sequence[Mapping[str, Any]]"  [arg-type]
tests/core/test_nest.py:111:14: error: Incompatible types in assignment (expression has type "list[object]", variable has type "dict[str, str | int | None]")  [assignment]
tests/core/test_nest.py:116:23: error: Argument 1 to "nest" has incompatible type "dict[str, str | int | None]"; expected "Sequence[Mapping[str, Any]]"  [arg-type]
tests/core/test_groupby.py:26:22: error: Argument 1 to "groupby" has incompatible type "list[dict[str, object]]"; expected "Sequence[Mapping[str, None]]"  [arg-type]
tests/core/test_groupby.py:33:21: error: Non-overlapping container check (element type: "int", container item type: "str | None")  [comparison-overlap]
tests/core/test_groupby.py:34:21: error: Non-overlapping container check (element type: "int", container item type: "str | None")  [comparison-overlap]
tests/core/test_groupby.py:35:21: error: Non-overlapping container check (element type: "int", container item type: "str | None")  [comparison-overlap]
tests/core/test_groupby.py:36:21: error: Non-overlapping container check (element type: "int", container item type: "str | None")  [comparison-overlap]
tests/core/test_groupby.py:43:34: error: Invalid index type "int" for "dict[str | None, list[Any]]"; expected type "str | None"  [index]
tests/core/test_groupby.py:44:34: error: Invalid index type "int" for "dict[str | None, list[Any]]"; expected type "str | None"  [index]
tests/core/test_groupby.py:45:34: error: Invalid index type "int" for "dict[str | None, list[Any]]"; expected type "str | None"  [index]
tests/core/test_groupby.py:46:34: error: Invalid index type "int" for "dict[str | None, list[Any]]"; expected type "str | None"  [index]
tests/core/test_groupby.py:50:32: error: Invalid index type "int" for "dict[str | None, list[Any]]"; expected type "str | None"  [index]
tests/core/test_groupby.py:51:32: error: Invalid index type "int" for "dict[str | None, list[Any]]"; expected type "str | None"  [index]
tests/core/test_groupby.py:52:32: error: Invalid index type "int" for "dict[str | None, list[Any]]"; expected type "str | None"  [index]
tests/core/test_groupby.py:53:32: error: Invalid index type "int" for "dict[str | None, list[Any]]"; expected type "str | None"  [index]
benedict/dicts/keypath/keypath_dict.py:20:37: error: Argument 1 to "check_keys" has incompatible type "KeypathDict[_K, _V]"; expected "Mapping[str, Any]"  [arg-type]
benedict/dicts/keypath/keypath_dict.py:20:43: error: Argument 2 to "check_keys" has incompatible type "str | None"; expected "str"  [arg-type]
benedict/dicts/keypath/keypath_dict.py:28:33: error: Argument 1 to "check_keys" has incompatible type "KeypathDict[_K, _V]"; expected "Mapping[str, Any]"  [arg-type]
benedict/dicts/keypath/keypath_dict.py:32:53: error: Argument 1 to "_parse_key" of "KeypathDict" has incompatible type "object"; expected "_K"  [arg-type]
benedict/dicts/keypath/keypath_dict.py:35:29: error: Argument 1 to "__delitem__" of "KeylistDict" has incompatible type "str | list[str] | None"; expected "_K | list[Any]"  [arg-type]
benedict/dicts/keypath/keypath_dict.py:35:45: error: Argument 1 to "_parse_key" of "KeypathDict" has incompatible type "object"; expected "_K"  [arg-type]
benedict/dicts/keypath/keypath_dict.py:38:36: error: Invalid index type "str | list[str] | None" for "KeypathDict[_K, _V]"; expected type "_K"  [index]
benedict/dicts/keypath/keypath_dict.py:41:33: error: Argument 1 to "check_keys" has incompatible type "_V"; expected "Mapping[str, Any]"  [arg-type]
benedict/dicts/keypath/keypath_dict.py:41:40: error: Argument 2 to "check_keys" has incompatible type "str | None"; expected "str"  [arg-type]
benedict/dicts/keypath/keypath_dict.py:42:29: error: Invalid index type "str | list[str] | None" for "KeypathDict[_K, _V]"; expected type "_K"  [index]
benedict/dicts/keypath/keypath_dict.py:44:28: error: Argument 1 of "__setstate__" is incompatible with supertype "BaseDict"; supertype defines the argument type as "Mapping[str, Any]"  [override]
benedict/dicts/keypath/keypath_dict.py:44:28: note: This violates the Liskov substitution principle
benedict/dicts/keypath/keypath_dict.py:44:28: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
benedict/dicts/keypath/keypath_dict.py:49:40: error: Argument 1 to "parse_keys" has incompatible type "_K"; expected "str | list[str]"  [arg-type]
benedict/dicts/keypath/keypath_dict.py:58:5: error: Signature of "fromkeys" incompatible with supertype "dict"  [override]
benedict/dicts/keypath/keypath_dict.py:58:5: note:      Superclass:
benedict/dicts/keypath/keypath_dict.py:58:5: note:          @overload
benedict/dicts/keypath/keypath_dict.py:58:5: note:          def [_T] fromkeys(cls, Iterable[_T], None = ..., /) -> dict[_T, Any | None]
benedict/dicts/keypath/keypath_dict.py:58:5: note:          @overload
benedict/dicts/keypath/keypath_dict.py:58:5: note:          def [_T, _S] fromkeys(cls, Iterable[_T], _S, /) -> dict[_T, _S]
benedict/dicts/keypath/keypath_dict.py:58:5: note:      Subclass:
benedict/dicts/keypath/keypath_dict.py:58:5: note:          @classmethod
benedict/dicts/keypath/keypath_dict.py:58:5: note:          def fromkeys(cls, sequence: Iterable[str], value: _V | None = ...) -> KeypathDict[_K, _V]
benedict/dicts/keypath/keypath_dict.py:61:15: error: Invalid index type "str" for "Self"; expected type "_K"  [index]
benedict/dicts/keypath/keypath_dict.py:61:22: error: Incompatible types in assignment (expression has type "_V | None", target has type "_V")  [assignment]
benedict/dicts/keypath/keypath_dict.py:64:5: error: Signature of "get" incompatible with supertype "dict"  [override]
benedict/dicts/keypath/keypath_dict.py:64:5: note:      Superclass:
benedict/dicts/keypath/keypath_dict.py:64:5: note:          @overload
benedict/dicts/keypath/keypath_dict.py:64:5: note:          def get(self, _K, /) -> _V | None
benedict/dicts/keypath/keypath_dict.py:64:5: note:          @overload
benedict/dicts/keypath/keypath_dict.py:64:5: note:          def get(self, _K, _V, /) -> _V
benedict/dicts/keypath/keypath_dict.py:64:5: note:          @overload
benedict/dicts/keypath/keypath_dict.py:64:5: note:          def [_T] get(self, _K, _T, /) -> _V | _T
benedict/dicts/keypath/keypath_dict.py:64:5: note:      Subclass:
benedict/dicts/keypath/keypath_dict.py:64:5: note:          def get(self, key: _K, default: _V | None = ...) -> _V | None
benedict/dicts/keypath/keypath_dict.py:64:5: error: Signature of "get" incompatible with supertype "Mapping"  [override]
benedict/dicts/keypath/keypath_dict.py:64:5: note:      Superclass:
benedict/dicts/keypath/keypath_dict.py:64:5: note:          @overload
benedict/dicts/keypath/keypath_dict.py:64:5: note:          def get(self, _K, /) -> _V | None
benedict/dicts/keypath/keypath_dict.py:64:5: note:          @overload
benedict/dicts/keypath/keypath_dict.py:64:5: note:          def [_T] get(self, _K, /, default: _V | _T) -> _V | _T
benedict/dicts/keypath/keypath_dict.py:64:5: note:      Subclass:
benedict/dicts/keypath/keypath_dict.py:64:5: note:          def get(self, key: _K, default: _V | None = ...) -> _V | None
benedict/dicts/keypath/keypath_dict.py:64:19: error: Argument 1 of "get" is incompatible with supertype "KeylistDict"; supertype defines the argument type as "_K | Sequence[str]"  [override]
benedict/dicts/keypath/keypath_dict.py:64:19: note: This violates the Liskov substitution principle
benedict/dicts/keypath/keypath_dict.py:64:19: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
benedict/dicts/keypath/keypath_dict.py:64:28: error: Argument 2 of "get" is incompatible with supertype "KeylistDict"; supertype defines the argument type as "_T | _V | None"  [override]
benedict/dicts/keypath/keypath_dict.py:65:28: error: Argument 1 to "get" of "KeylistDict" has incompatible type "str | list[str] | None"; expected "_K | Sequence[str]"  [arg-type]
benedict/dicts/keypath/keypath_dict.py:68:9: error: Returning Any from function declared to return "_V"  [no-any-return]
benedict/dicts/keypath/keypath_dict.py:68:28: error: Argument 1 to "pop" of "KeylistDict" has incompatible type "str | list[str] | None"; expected "_K | list[str]"  [arg-type]
benedict/dicts/keypath/keypath_dict.py:68:44: error: Argument 1 to "_parse_key" of "KeypathDict" has incompatible type "_K | list[str]"; expected "_K"  [arg-type]
benedict/dicts/keypath/keypath_dict.py:70:5: error: Signature of "update" incompatible with supertype "MutableMapping"  [override]
benedict/dicts/keypath/keypath_dict.py:70:5: note:      Superclass:
benedict/dicts/keypath/keypath_dict.py:70:5: note:          @overload
benedict/dicts/keypath/keypath_dict.py:70:5: note:          def update(self, SupportsKeysAndGetItem[_K, _V], /, **kwargs: _V) -> None
benedict/dicts/keypath/keypath_dict.py:70:5: note:          @overload
benedict/dicts/keypath/keypath_dict.py:70:5: note:          def update(self, Iterable[tuple[_K, _V]], /, **kwargs: _V) -> None
benedict/dicts/keypath/keypath_dict.py:70:5: note:          @overload
benedict/dicts/keypath/keypath_dict.py:70:5: note:          def update(self, **kwargs: _V) -> None
benedict/dicts/keypath/keypath_dict.py:70:5: note:      Subclass:
benedict/dicts/keypath/keypath_dict.py:70:5: note:          def update(self, other: Any) -> None
benedict/dicts/keypath/keypath_dict.py:71:40: error: Argument 2 to "check_keys" has incompatible type "str | None"; expected "str"  [arg-type]
benedict/dicts/__init__.py:90:17: error: Invalid index type "str" for "Self"; expected type "_K"  [index]
benedict/dicts/__init__.py:93:5: error: Return type "benedict[_K, _V] | _V" of "__getitem__" incompatible with return type "_V" in supertype "KeypathDict"  [override]
benedict/dicts/__init__.py:93:5: error: Return type "benedict[_K, _V] | _V" of "__getitem__" incompatible with return type "_V" in supertype "KeylistDict"  [override]
benedict/dicts/__init__.py:93:5: error: Return type "benedict[_K, _V] | _V" of "__getitem__" incompatible with return type "_V" in supertype "BaseDict"  [override]
benedict/dicts/__init__.py:93:5: error: Return type "benedict[_K, _V] | _V" of "__getitem__" incompatible with return type "_V" in supertype "dict"  [override]
benedict/dicts/__init__.py:93:5: error: Return type "benedict[_K, _V] | _V" of "__getitem__" incompatible with return type "_V" in supertype "Mapping"  [override]
benedict/dicts/__init__.py:97:34: error: Incompatible types in assignment (expression has type "_V | benedict[_K, _V]", target has type "_V")  [assignment]
benedict/dicts/__init__.py:162:37: error: Argument 1 to "filter" has incompatible type "Self"; expected "MutableMapping[str, Any | None]"  [arg-type]
benedict/dicts/__init__.py:162:43: error: Argument 2 to "filter" has incompatible type "Callable[[str, _V], bool]"; expected "Callable[[str, Any | None], bool]"  [arg-type]
benedict/dicts/__init__.py:169:16: error: Cannot infer type argument 1 of "find"  [misc]
benedict/dicts/__init__.py:181:25: error: Argument 1 to "flatten" has incompatible type "benedict[_K, _V]"; expected "MutableMapping[str, _V]"  [arg-type]
benedict/dicts/__init__.py:183:5: error: Return type "benedict[_K, _V] | _V | None" of "get" incompatible with return type "_V | None" in supertype "KeypathDict"  [override]
benedict/dicts/__init__.py:183:5: error: Return type "benedict[_K, _V] | _V | None" of "get" incompatible with return type "_T | _V | None" in supertype "KeylistDict"  [override]
benedict/dicts/__init__.py:183:5: error: Return type "benedict[_K, _V] | _V | None" of "get" incompatible with return type "_V | None" in supertype "BaseDict"  [override]
benedict/dicts/__init__.py:183:5: error: Signature of "get" incompatible with supertype "dict"  [override]
benedict/dicts/__init__.py:183:5: note:      Superclass:
benedict/dicts/__init__.py:183:5: note:          @overload
benedict/dicts/__init__.py:183:5: note:          def get(self, _K, /) -> _V | None
benedict/dicts/__init__.py:183:5: note:          @overload
benedict/dicts/__init__.py:183:5: note:          def get(self, _K, _V, /) -> _V
benedict/dicts/__init__.py:183:5: note:          @overload
benedict/dicts/__init__.py:183:5: note:          def [_T] get(self, _K, _T, /) -> _V | _T
benedict/dicts/__init__.py:183:5: note:      Subclass:
benedict/dicts/__init__.py:183:5: note:          def get(self, key: _K, default: _V | None = ...) -> benedict[_K, _V] | _V | None
benedict/dicts/__init__.py:183:5: error: Signature of "get" incompatible with supertype "Mapping"  [override]
benedict/dicts/__init__.py:183:5: note:      Superclass:
benedict/dicts/__init__.py:183:5: note:          @overload
benedict/dicts/__init__.py:183:5: note:          def get(self, _K, /) -> _V | None
benedict/dicts/__init__.py:183:5: note:          @overload
benedict/dicts/__init__.py:183:5: note:          def [_T] get(self, _K, /, default: _V | _T) -> _V | _T
benedict/dicts/__init__.py:183:5: note:      Subclass:
benedict/dicts/__init__.py:183:5: note:          def get(self, key: _K, default: _V | None = ...) -> benedict[_K, _V] | _V | None
benedict/dicts/__init__.py:183:19: error: Argument 1 of "get" is incompatible with supertype "KeylistDict"; supertype defines the argument type as "_K | Sequence[str]"  [override]
benedict/dicts/__init__.py:183:19: note: This violates the Liskov substitution principle
benedict/dicts/__init__.py:183:19: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
benedict/dicts/__init__.py:183:28: error: Argument 2 of "get" is incompatible with supertype "KeylistDict"; supertype defines the argument type as "_T | _V | None"  [override]
benedict/dicts/__init__.py:189:5: error: Function is missing a type annotation  [no-untyped-def]
benedict/dicts/__init__.py:192:5: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
benedict/dicts/__init__.py:196:27: error: Argument 1 to "_cast" of "benedict" has incompatible type "dict[Any | None, list[Any]]"; expected "Self"  [arg-type]
benedict/dicts/__init__.py:196:36: error: Argument 1 to "groupby" has incompatible type "Self | _V"; expected "Sequence[Mapping[Any, None]]"  [arg-type]
benedict/dicts/__init__.py:198:5: error: Function is missing a return type annotation  [no-untyped-def]
benedict/dicts/__init__.py:206:5: error: Return type "Iterator[tuple[str, Any]]" of "items" incompatible with return type "ItemsView[str, _V]" in supertype "BaseDict"  [override]
benedict/dicts/__init__.py:206:5: error: Return type "Iterator[tuple[str, Any]]" of "items" incompatible with return type "dict_items[_K, _V]" in supertype "dict"  [override]
benedict/dicts/__init__.py:206:5: error: Return type "Iterator[tuple[str, Any]]" of "items" incompatible with return type "ItemsView[_K, _V]" in supertype "Mapping"  [override]
benedict/dicts/__init__.py:210:5: error: Function is missing a return type annotation  [no-untyped-def]
benedict/dicts/__init__.py:217:5: error: Function is missing a return type annotation  [no-untyped-def]
benedict/dicts/__init__.py:224:5: error: Function is missing a return type annotation  [no-untyped-def]
benedict/dicts/__init__.py:230:29: error: Argument "separator" to "keypaths" has incompatible type "str | None"; expected "str"  [arg-type]
benedict/dicts/__init__.py:233:5: error: Function is missing a return type annotation  [no-untyped-def]
benedict/dicts/__init__.py:241:48: error: Argument "separator" to "match" has incompatible type "str | None"; expected "str"  [arg-type]
benedict/dicts/__init__.py:243:5: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
benedict/dicts/__init__.py:252:44: error: Argument 2 to "check_keys" has incompatible type "str | None"; expected "str"  [arg-type]
benedict/dicts/__init__.py:255:5: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
benedict/dicts/__init__.py:262:5: error: Function is missing a return type annotation  [no-untyped-def]
benedict/dicts/__init__.py:265:22: error: Incompatible default for argument "id_key" (default has type "str", argument has type "_K")  [assignment]
benedict/dicts/__init__.py:266:29: error: Incompatible default for argument "parent_id_key" (default has type "str", argument has type "_K")  [assignment]
benedict/dicts/__init__.py:267:28: error: Incompatible default for argument "children_key" (default has type "str", argument has type "_K")  [assignment]
benedict/dicts/__init__.py:273:22: error: Argument 1 to "nest" has incompatible type "benedict[_K, _V] | _V"; expected "Sequence[Mapping[str, Any]]"  [arg-type]
benedict/dicts/__init__.py:273:33: error: Argument 2 to "nest" has incompatible type "_K"; expected "str"  [arg-type]
benedict/dicts/__init__.py:273:41: error: Argument 3 to "nest" has incompatible type "_K"; expected "str"  [arg-type]
benedict/dicts/__init__.py:273:56: error: Argument 4 to "nest" has incompatible type "_K"; expected "str"  [arg-type]
benedict/dicts/__init__.py:275:5: error: Return type "_V | benedict[_K, _V]" of "pop" incompatible with return type "_V" in supertype "KeypathDict"  [override]
benedict/dicts/__init__.py:275:5: error: Return type "_V | benedict[_K, _V]" of "pop" incompatible with return type "_V" in supertype "BaseDict"  [override]
benedict/dicts/__init__.py:275:5: error: Signature of "pop" incompatible with supertype "dict"  [override]
benedict/dicts/__init__.py:275:5: note:      Superclass:
benedict/dicts/__init__.py:275:5: note:          @overload
benedict/dicts/__init__.py:275:5: note:          def pop(self, _K, /) -> _V
benedict/dicts/__init__.py:275:5: note:          @overload
benedict/dicts/__init__.py:275:5: note:          def pop(self, _K, _V, /) -> _V
benedict/dicts/__init__.py:275:5: note:          @overload
benedict/dicts/__init__.py:275:5: note:          def [_T] pop(self, _K, _T, /) -> _V | _T
benedict/dicts/__init__.py:275:5: note:      Subclass:
benedict/dicts/__init__.py:275:5: note:          def pop(self, key: _K, *args: Any) -> _V | benedict[_K, _V]
benedict/dicts/__init__.py:275:5: error: Signature of "pop" incompatible with supertype "MutableMapping"  [override]
benedict/dicts/__init__.py:275:5: note:      Superclass:
benedict/dicts/__init__.py:275:5: note:          @overload
benedict/dicts/__init__.py:275:5: note:          def pop(self, _K, /) -> _V
benedict/dicts/__init__.py:275:5: note:          @overload
benedict/dicts/__init__.py:275:5: note:          def pop(self, _K, /, default: _V) -> _V
benedict/dicts/__init__.py:275:5: note:          @overload
benedict/dicts/__init__.py:275:5: note:          def [_T] pop(self, _K, /, default: _T) -> _V | _T
benedict/dicts/__init__.py:275:5: note:      Subclass:
benedict/dicts/__init__.py:275:5: note:          def pop(self, key: _K, *args: Any) -> _V | benedict[_K, _V]
benedict/dicts/__init__.py:275:19: error: Argument 1 of "pop" is incompatible with supertype "KeypathDict"; supertype defines the argument type as "_K | list[str]"  [override]
benedict/dicts/__init__.py:275:19: note: This violates the Liskov substitution principle
benedict/dicts/__init__.py:275:19: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
benedict/dicts/__init__.py:275:19: error: Argument 1 of "pop" is incompatible with supertype "KeylistDict"; supertype defines the argument type as "_K | list[str]"  [override]
benedict/dicts/__init__.py:278:5: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
benedict/dicts/__init__.py:283:17: error: Argument 1 to "remove" has incompatible type "benedict[_K, _V]"; expected "MutableMapping[str, Any]"  [arg-type]
benedict/dicts/__init__.py:285:5: error: Function is missing a type annotation  [no-untyped-def]
benedict/dicts/__init__.py:288:5: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
benedict/dicts/__init__.py:293:17: error: Argument 1 to "rename" has incompatible type "benedict[_K, _V]"; expected "MutableMapping[str, Any]"  [arg-type]
benedict/dicts/__init__.py:306:16: error: Incompatible return value type (got "list[tuple[Mapping[str, Any] | Sequence[Any] | None, str | int, Any | None]]", expected "list[tuple[dict[str, Any], str, Any]]")  [return-value]
benedict/dicts/__init__.py:306:24: error: Argument 1 to "search" has incompatible type "benedict[_K, _V]"; expected "Mapping[str, Any]"  [arg-type]
benedict/dicts/__init__.py:314:5: error: Function is missing a return type annotation  [no-untyped-def]
benedict/dicts/__init__.py:314:5: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
benedict/dicts/__init__.py:334:5: error: Function is missing a return type annotation  [no-untyped-def]
benedict/dicts/__init__.py:339:27: error: Argument 1 to "unflatten" has incompatible type "benedict[_K, _V]"; expected "MutableMapping[str, Any]"  [arg-type]
benedict/dicts/__init__.py:347:5: error: Return type "Iterable[benedict[_K, _V]]" of "values" incompatible with return type "ValuesView[_V]" in supertype "BaseDict"  [override]
benedict/dicts/__init__.py:347:5: error: Return type "Iterable[benedict[_K, _V]]" of "values" incompatible with return type "dict_values[_K, _V]" in supertype "dict"  [override]
benedict/dicts/__init__.py:347:5: error: Return type "Iterable[benedict[_K, _V]]" of "values" incompatible with return type "ValuesView[_V]" in supertype "Mapping"  [override]
benedict/dicts/__init__.py:349:30: error: Argument 1 to "_cast" of "benedict" has incompatible type "_V"; expected "Self"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:149:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "int"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:164:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "None"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:165:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "bool"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:166:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "bool"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:167:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "int"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:191:28: error: Invalid index type "None" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:192:28: error: Invalid index type "bool" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:194:19: error: Invalid index type "bool" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:196:28: error: Invalid index type "int" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:262:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "list[Never]"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:274:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "list[Never]"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:276:19: error: Argument 1 to "get" of "KeypathDict" has incompatible type "list[str]"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:284:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "list[str]"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:285:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "list[str]"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:286:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "list[str]"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:287:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "list[str]"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:299:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "list[str]"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:300:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "list[str]"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:301:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "list[str]"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:302:32: error: Argument 1 to "get" of "KeypathDict" has incompatible type "list[str]"; expected "str"  [arg-type]
tests/dicts/keypath/test_keypath_dict.py:337:28: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:338:28: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:339:28: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:341:19: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:354:19: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:356:28: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:357:28: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:359:19: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:362:13: error: Need type annotation for "d"  [var-annotated]
tests/dicts/keypath/test_keypath_dict.py:374:13: error: Need type annotation for "d"  [var-annotated]
tests/dicts/keypath/test_keypath_dict.py:390:13: error: Need type annotation for "d"  [var-annotated]
tests/dicts/keypath/test_keypath_dict.py:431:25: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:432:25: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:433:25: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:434:26: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:435:25: error: Non-overlapping container check (element type: "list[object]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:436:25: error: Non-overlapping container check (element type: "list[object]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:437:25: error: Non-overlapping container check (element type: "list[object]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:438:25: error: Non-overlapping container check (element type: "list[object]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:439:26: error: Non-overlapping container check (element type: "list[object]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:451:26: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:452:25: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:453:25: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:454:26: error: Non-overlapping container check (element type: "list[str]", container item type: "str")  [comparison-overlap]
tests/dicts/keypath/test_keypath_dict.py:476:9: error: Need type annotation for "d" (hint: "d: dict[<type>, <type>] = ...")  [var-annotated]
tests/dicts/keypath/test_keypath_dict.py:484:26: error: Dict entry 0 has incompatible type "str": "dict[str, int]"; expected "str": "int"  [dict-item]
tests/dicts/keypath/test_keypath_dict.py:488:9: error: Need type annotation for "d" (hint: "d: dict[<type>, <type>] = ...")  [var-annotated]
tests/dicts/keypath/test_keypath_dict.py:496:26: error: Dict entry 0 has incompatible type "str": "dict[str, int]"; expected "str": "int"  [dict-item]
tests/dicts/keypath/test_keypath_dict.py:509:11: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:511:11: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:513:11: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:515:11: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:528:11: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:531:28: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:533:11: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:536:28: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:538:11: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/dicts/keypath/test_keypath_dict.py:541:28: error: Invalid index type "list[str]" for "KeypathDict[str, Any]"; expected type "str"  [index]
tests/stackoverflow/test_question_59176476.py:146:24: error: Argument 1 to "benedict" has incompatible type "Collection[str]"; expected "Mapping[str, Any] | Iterable[tuple[str, Any]] | str | None"  [arg-type]
tests/stackoverflow/test_question_59176476.py:146:29: error: Invalid index type "list[str]" for "benedict[str, dict[str, Collection[str]]]"; expected type "str"  [index]
tests/stackoverflow/test_question_59176476.py:146:80: error: Invalid index type "int" for "benedict[str, dict[str, Collection[str]]]"; expected type "str"  [index]
tests/stackoverflow/test_question_59176476.py:146:80: error: Invalid index type "int" for "dict[str, Collection[str]]"; expected type "str"  [index]
tests/stackoverflow/test_question_58827592.py:33:33: error: Invalid index type "str" for "str"; expected type "SupportsIndex | slice[Any, Any, Any]"  [index]
tests/github/test_issue_0432.py:19:12: error: Invalid index type "tuple[int, int, int]" for "benedict[str, Any]"; expected type "str"  [index]
tests/github/test_issue_0432.py:27:12: error: Invalid index type "tuple[str, bool]" for "benedict[str, Any]"; expected type "str"  [index]
tests/github/test_issue_0355.py:20:31: error: Argument 1 to "from_xls" of "IODict" has incompatible type "Path"; expected "str"  [arg-type]
tests/github/test_issue_0355.py:35:31: error: Argument 1 to "from_xls" of "IODict" has incompatible type "Path"; expected "str"  [arg-type]
tests/github/test_issue_0334.py:29:15: error: Argument 1 to "__ior__" of "BaseDict" has incompatible type "benedict[str, str]"; expected "SupportsKeysAndGetItem[str, str]"  [arg-type]
tests/github/test_issue_0294.py:17:18: error: Incompatible types in assignment (expression has type "benedict[str, dict[str, int]] | dict[str, int]", target has type "dict[str, int]")  [assignment]
tests/github/test_issue_0144.py:18:22: error: Argument 1 to "benedict" has incompatible type "Path"; expected "Mapping[str, Any] | Iterable[tuple[str, Any]] | str | None"  [arg-type]
tests/github/test_issue_0144.py:24:17: error: Argument 1 to "benedict" has incompatible type "Path"; expected "Mapping[str, Any] | Iterable[tuple[str, Any]] | str | None"  [arg-type]
tests/github/test_issue_0110.py:18:27: error: Argument 1 to "benedict" has incompatible type "dict[str, int]"; expected "Mapping[str, dict[str, int]] | Iterable[tuple[str, dict[str, int]]] | str | None"  [arg-type]
tests/github/test_issue_0102.py:68:37: error: Argument 1 to "benedict" has incompatible type "dict[str, str]"; expected "Mapping[str, benedict[str, benedict[str, str]]] | Iterable[tuple[str, benedict[str, benedict[str, str]]]] | str | None"  [arg-type]
tests/github/test_issue_0102.py:68:37: error: Argument 1 to "benedict" has incompatible type "dict[str, str]"; expected "Mapping[str, benedict[str, str]] | Iterable[tuple[str, benedict[str, str]]] | str | None"  [arg-type]
tests/github/test_issue_0043.py:27: error: Unused "type: ignore" comment  [unused-ignore]
tests/github/test_issue_0043.py:28: error: Unused "type: ignore" comment  [unused-ignore]
tests/github/test_issue_0043.py:28:29: error: Argument 1 to "dict" has incompatible type "benedict[str, benedict[str, dict[str, str]] | dict[str, str]]"; expected "SupportsKeysAndGetItem[str, benedict[str, dict[str, str]] | dict[str, str]]"  [arg-type]
tests/github/test_issue_0043.py:28:29: note: Error code "arg-type" not covered by "type: ignore" comment
tests/github/test_issue_0038.py:26:13: error: Cannot infer type argument 1 of "dict"  [misc]
tests/github/test_issue_0034.py:42:9: error: Value of type "object" is not indexable  [index]
tests/github/test_issue_0034.py:59:9: error: Value of type "object" is not indexable  [index]
tests/github/test_issue_0027.py:25:42: error: Argument 1 to "append" of "list" has incompatible type "str"; expected "dict[str, list[str]]"  [arg-type]
tests/dicts/test_benedict_keyattr.py:168:13: error: "Callable[[], Iterator[tuple[str, Any]]]" has no attribute "append"  [attr-defined]
tests/dicts/test_benedict_casting.py:24:30: error: Value of type "object" is not indexable  [index]
tests/dicts/test_benedict_casting.py:25:31: error: Value of type "object" is not indexable  [index]
tests/dicts/test_benedict_casting.py:114:30: error: Value of type "object" is not indexable  [index]
tests/dicts/test_benedict_casting.py:115:31: error: Value of type "object" is not indexable  [index]
tests/dicts/test_benedict_casting.py:130:30: error: Value of type "object" is not indexable  [index]
tests/dicts/test_benedict_casting.py:131:31: error: Value of type "object" is not indexable  [index]
tests/dicts/test_benedict_casting.py:151:13: error: Call to untyped function "get_list_item" in typed context  [no-untyped-call]
tests/dicts/test_benedict_casting.py:154:30: error: Value of type "object" is not indexable  [index]
tests/dicts/test_benedict_casting.py:171:13: error: Value of type "object" is not indexable  [index]
tests/dicts/test_benedict.py:72:28: error: Incompatible types in assignment (expression has type "int", target has type "dict[str, dict[str, int]]")  [assignment]
tests/dicts/test_benedict.py:72:28: error: Incompatible types in assignment (expression has type "int", target has type "dict[str, int]")  [assignment]
tests/dicts/test_benedict.py:90:22: error: Incompatible types in assignment (expression has type "int", target has type "dict[str, dict[str, int]]")  [assignment]
tests/dicts/test_benedict.py:119:22: error: Incompatible types in assignment (expression has type "int", target has type "dict[str, dict[str, int]]")  [assignment]
tests/dicts/test_benedict.py:302:26: error: Argument 1 to "filter" of "benedict" has incompatible type "bool"; expected "Callable[[str, object], bool]"  [arg-type]
tests/dicts/test_benedict.py:441:47: error: "MutableMapping[str, object]" has no attribute "keypath_separator"  [attr-defined]
tests/dicts/test_benedict.py:945:22: error: Call to untyped function "get_list_item" in typed context  [no-untyped-call]
tests/dicts/test_benedict.py:1031:25: error: Unsupported operand types for in ("benedict[str, list[dict[str, str]]] | list[dict[str, str]] | dict[str, str]" and "benedict[str, list[dict[str, str]]] | list[dict[str, str]]")  [operator]
tests/dicts/test_benedict.py:1031:35: error: Invalid index type "int" for "benedict[str, list[dict[str, str]]]"; expected type "str"  [index]
tests/dicts/test_benedict.py:1032:25: error: Unsupported operand types for in ("benedict[str, list[dict[str, str]]] | list[dict[str, str]] | dict[str, str]" and "benedict[str, list[dict[str, str]]] | list[dict[str, str]]")  [operator]
tests/dicts/test_benedict.py:1032:35: error: Invalid index type "int" for "benedict[str, list[dict[str, str]]]"; expected type "str"  [index]
tests/dicts/test_benedict.py:1033:25: error: Unsupported operand types for in ("benedict[str, list[dict[str, str]]] | list[dict[str, str]] | dict[str, str]" and "benedict[str, list[dict[str, str]]] | list[dict[str, str]]")  [operator]
tests/dicts/test_benedict.py:1033:35: error: Invalid index type "int" for "benedict[str, list[dict[str, str]]]"; expected type "str"  [index]
tests/dicts/test_benedict.py:1034:25: error: Unsupported operand types for in ("benedict[str, list[dict[str, str]]] | list[dict[str, str]] | dict[str, str]" and "benedict[str, list[dict[str, str]]] | list[dict[str, str]]")  [operator]
tests/dicts/test_benedict.py:1034:35: error: Invalid index type "int" for "benedict[str, list[dict[str, str]]]"; expected type "str"  [index]
tests/dicts/test_benedict.py:1035:25: error: Unsupported operand types for in ("benedict[str, list[dict[str, str]]] | list[dict[str, str]] | dict[str, str]" and "benedict[str, list[dict[str, str]]] | list[dict[str, str]]")  [operator]
tests/dicts/test_benedict.py:1035:35: error: Invalid index type "int" for "benedict[str, list[dict[str, str]]]"; expected type "str"  [index]
tests/dicts/test_benedict.py:1036:25: error: Unsupported operand types for in ("benedict[str, list[dict[str, str]]] | list[dict[str, str]] | dict[str, str]" and "benedict[str, list[dict[str, str]]] | list[dict[str, str]]")  [operator]
tests/dicts/test_benedict.py:1036:35: error: Invalid index type "int" for "benedict[str, list[dict[str, str]]]"; expected type "str"  [index]
tests/dicts/test_benedict.py:1039:25: error: Unsupported operand types for in ("benedict[str, list[dict[str, str]]] | list[dict[str, str]] | dict[str, str]" and "benedict[str, list[dict[str, str]]] | list[dict[str, str]]")  [operator]
tests/dicts/test_benedict.py:1039:35: error: Invalid index type "int" for "benedict[str, list[dict[str, str]]]"; expected type "str"  [index]
tests/dicts/test_benedict.py:1040:25: error: Unsupported operand types for in ("benedict[str, list[dict[str, str]]] | list[dict[str, str]] | dict[str, str]" and "benedict[str, list[dict[str, str]]] | list[dict[str, str]]")  [operator]
tests/dicts/test_benedict.py:1040:35: error: Invalid index type "int" for "benedict[str, list[dict[str, str]]]"; expected type "str"  [index]
tests/dicts/test_benedict.py:1043:25: error: Unsupported operand types for in ("benedict[str, list[dict[str, str]]] | list[dict[str, str]] | dict[str, str]" and "benedict[str, list[dict[str, str]]] | list[dict[str, str]]")  [operator]
tests/dicts/test_benedict.py:1043:35: error: Invalid index type "int" for "benedict[str, list[dict[str, str]]]"; expected type "str"  [index]
tests/dicts/test_benedict.py:1044:25: error: Unsupported operand types for in ("benedict[str, list[dict[str, str]]] | list[dict[str, str]] | dict[str, str]" and "benedict[str, list[dict[str, str]]] | list[dict[str, str]]")  [operator]
tests/dicts/test_benedict.py:1044:35: error: Invalid index type "int" for "benedict[str, list[dict[str, str]]]"; expected type "str"  [index]
tests/dicts/test_benedict.py:1798:17: error: Value of type "Collection[str]" is not indexable  [index]
tests/dicts/test_benedict.py:1800:17: error: Value of type "Collection[str]" is not indexable  [index]
tests/dicts/test_benedict.py:1826:13: error: Unsupported operand types for in ("tuple[Collection[str], str, Any]" and "list[tuple[dict[str, Any], str, Any]]")  [operator]
tests/dicts/test_benedict.py:1829:17: error: Value of type "Collection[str]" is not indexable  [index]
tests/dicts/test_benedict.py:1835:17: error: Value of type "Collection[str]" is not indexable  [index]
tests/dicts/test_benedict.py:1837:17: error: Value of type "Collection[str]" is not indexable  [index]
tests/dicts/test_benedict.py:1843:17: error: Value of type "Collection[str]" is not indexable  [index]
tests/dicts/test_benedict.py:1845:17: error: Value of type "Collection[str]" is not indexable  [index]
tests/dicts/test_benedict.py:1864:17: error: Value of type "Collection[str]" is not indexable  [index]
tests/dicts/test_benedict.py:1866:17: error: Value of type "Collection[str]" is not indexable  [index]
tests/dicts/test_benedict.py:2141:9: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
Found 388 errors in 28 files (checked 181 source files)

Tatsh avatar Apr 29 '25 04:04 Tatsh

Until https://github.com/python/typing/issues/548 is settled, we cannot have fully generic functions in benedict.core. And a lot of things can be solved with the new generic syntax, but it requires Python 3.13.

Tatsh avatar Apr 30 '25 16:04 Tatsh

@fabiocaccamo This is ready for review. Also inviting @pirate.

Tatsh avatar Apr 30 '25 17:04 Tatsh

Codecov Report

:x: Patch coverage is 99.11504% with 7 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 97.68%. Comparing base (de5ea2d) to head (c307e3c). :warning: Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
benedict/serializers/base64.py 89.47% 2 Missing :warning:
benedict/dicts/base/base_dict.py 98.64% 1 Missing :warning:
benedict/serializers/cli.py 91.66% 1 Missing :warning:
benedict/serializers/csv.py 85.71% 1 Missing :warning:
benedict/serializers/xls.py 94.11% 1 Missing :warning:
benedict/utils/type_util.py 96.42% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #491      +/-   ##
==========================================
- Coverage   97.76%   97.68%   -0.08%     
==========================================
  Files          63       63              
  Lines        2011     2246     +235     
==========================================
+ Hits         1966     2194     +228     
- Misses         45       52       +7     
Flag Coverage Δ
unittests 97.68% <99.11%> (-0.08%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Apr 30 '25 19:04 codecov[bot]

@Tatsh @pirate thank you for the great work you did for this PR, and sorry for the late feedback.

I added mypy to pre-commit hooks - so it gets automatically executed when running the tests.

Could you please fix the failing checks/tests? I will be glad to merge this PR once all flags will be green.

fabiocaccamo avatar Jun 12 '25 20:06 fabiocaccamo

@fabiocaccamo The type stubs deps have to be in pre-commit config for Mypy to work.

Tatsh avatar Jun 13 '25 19:06 Tatsh

@Tatsh @pirate thank you again for this great PR.

fabiocaccamo avatar Sep 30 '25 20:09 fabiocaccamo