Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_support metadata: Mark data type as "optional"
``` test_support/test_support/metadata.py:274: error: Argument 10 to "StandardMetadata" has incompatible type "list[tuple[str, str]]"; expected "list[tuple[str, str | None]]" [arg-type] test_support/test_support/metadata.py:274: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance test_support/test_support/metadata.py:274: note: Consider using "Sequence" instead, which is covariant test_support/test_support/metadata.py:275: error: Argument 11 to "StandardMetadata" has incompatible type "list[tuple[str, str]]"; expected "list[tuple[str, str | None]]" [arg-type] test_support/test_support/metadata.py:275: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance test_support/test_support/metadata.py:275: note: Consider using "Sequence" instead, which is covariant ``` Not sure if `str | None` is valid in all Python versions we support, but I think `Optional[str]` and `Union[str, None]` if I'm not mistaken, more or less say the same thing. So let's go with the most concise and widely supported of these.
- Loading branch information