You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ mypy t.pyt.py:6: note: Revealed type is "Union[signxml.verifier.VerifyResult, builtins.list[signxml.verifier.VerifyResult]]"Success: no issues found in 1 source file
However, when we only expect one result, we only get one result, so this annotation is unhelpful. Callers shouldn't need to handle the list case.
I believe this can be fixed with typing.overload.
Would a PR be welcome to make that change?
The text was updated successfully, but these errors were encountered:
I've been working from a slightly out of date version and it looks like the expect_references argument has been deprecated and moved to a config object. Given that, I think the only way to make this return type annotation any better would be to make SignatureConfiguration generic on the value of expect_references, which sounds messy.
$ mypy t.pyt.py:9: note: Revealed type is "Union[signxml.verifier.VerifyResult, builtins.list[signxml.verifier.VerifyResult]]"Success: no issues found in 1 source file
The return type for this method is always a union of a single result or a list of results:
However, when we only expect one result, we only get one result, so this annotation is unhelpful. Callers shouldn't need to handle the
list
case.I believe this can be fixed with
typing.overload
.Would a PR be welcome to make that change?
The text was updated successfully, but these errors were encountered: