mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-31 16:44:25 +08:00
Added a few missing type arguments for generic types used in stdlib stubs
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>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
from typing import Any
|
||||
|
||||
# This is a >=3.7 module, so we conditionally include its source.
|
||||
if sys.version_info >= (3, 7):
|
||||
@@ -8,7 +9,7 @@ if sys.version_info >= (3, 7):
|
||||
from typing import BinaryIO, ContextManager, Iterator, TextIO, Union
|
||||
|
||||
Package = Union[str, ModuleType]
|
||||
Resource = Union[str, os.PathLike]
|
||||
Resource = Union[str, os.PathLike[Any]]
|
||||
def open_binary(package: Package, resource: Resource) -> BinaryIO: ...
|
||||
def open_text(package: Package, resource: Resource, encoding: str = ..., errors: str = ...) -> TextIO: ...
|
||||
def read_binary(package: Package, resource: Resource) -> bytes: ...
|
||||
|
||||
Reference in New Issue
Block a user