Closed sobolevn closed 7 months ago
Or we can just drop str
part :)
Because _T
has no bounds there.
Based on a comment in #469, it sounds as if this concern isn't in fact a problem because SimplePath
itself is parameterized by _T
. For now, I'm marking this as invalid, but happy to revisit, especially if someone can demonstrate for me how the current definition manifests problematic behavior.
Hi!
I was working on
typeshed
's types and we (well, @AlexWaygood) found that annotation of__truediv__
is not valid: https://github.com/python/importlib_metadata/blob/8e7b9689fc38ef3e834265fd78423a9933a33607/importlib_metadata/_meta.py#L55-L56Here's a small repro: https://mypy-play.net/?mypy=latest&python=3.11&gist=2f16bbbbaf5a1330cbbcae76b5987868
I propose using an
@overload
instead:Playground: https://mypy-play.net/?mypy=latest&python=3.11
I will send a PR with the fix :)