Skip to content

mypy 1.17 errors on attrs dict update with keyword argument syntax #1303

@zmoon

Description

@zmoon

Example where I noticed it:

uscrn/data.py:56: error: No overload variant of "update" of "MutableMapping" matches argument type "datetime"  [call-overload]
uscrn/data.py:56: note: Possible overload variants:
uscrn/data.py:56: note:     def update(self, SupportsKeysAndGetItem[Optional[Hashable], Any], /) -> None
uscrn/data.py:56: note:     def update(self, Iterable[tuple[Optional[Hashable], Any]], /) -> None

where that line is doing:

df.attrs.update(created=datetime_instance)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions