Noticed this in mypy-primer output in #5516 on this code: https://github.com/encode/starlette/blob/master/starlette/testclient.py#L74
It calls `iscoroutinefunction()` on an object that may be None, which got flagged as an error but is actually fine; it just returns False.
We could also potentially use TypeGuard here, especially for `iscoroutine` which is just an `isinstance` call.
* Replace all uses of StrPath, BytesPath, and AnyPath in Python 2 stubs.
* Add StrOrBytesPath as preferred alias for AnyPath.
* Replace all remaining AnyPath instances with StrOrBytesPath.
* Mark AnyPath as obsolete.
Part of #5470
I just found and fixed a bug in pyright's "missing type arguments" check. When type arguments were omitted for a generic type within a subscript expression, the error was being suppressed. With this bug fixed, I found several new cases where type arguments were missing in stdlib stubs. (#5130)
Co-authored-by: Eric Traut <erictr@microsoft.com>