Describe the bug
The 2nd argument of Cursor.executemany is typed as seq_of_parameters: Union[List[Sequence[Any]], List[Mapping[str, Any]]] in version 1.6.0. This causes type errors on more precise arguments:
error: Argument 2 to "executemany" of "Cursor" has incompatible type "list[tuple[str, str, str, str, int, str]]"; expected "list[Sequence[Any]] | list[Mapping[str, Any]]" [arg-type]
"list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
note: Consider using "Sequence" instead, which is covariant
This is a regression from version 1.5.0, where the type seq_of_parameters: List[Sequence[Any]] didn't cause that problem. Suggestion: just use sequence instead of list and add linting for that.
To reproduce
curs.executemany(sql, [("a", 1)])
Describe the bug
The 2nd argument of
Cursor.executemanyis typed asseq_of_parameters: Union[List[Sequence[Any]], List[Mapping[str, Any]]]in version 1.6.0. This causes type errors on more precise arguments:This is a regression from version 1.5.0, where the type
seq_of_parameters: List[Sequence[Any]]didn't cause that problem. Suggestion: just use sequence instead of list and add linting for that.To reproduce