Skip to content

Commit 675ae1a

Browse files
authored
Sync typeshed (#10495)
Source commit: python/typeshed@17bc1d8 This doesn't include some recent typeshed commits. In particular, this is from before the split of stdlib stubs to Python 2 and 3 variants. This way we can more easily narrow down issues it might have caused.
1 parent 0ce3eb9 commit 675ae1a

38 files changed

+1150
-1079
lines changed

mypy/typeshed/stdlib/@python2/os/path.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import sys
33
from _typeshed import AnyPath, BytesPath, StrPath
4-
from genericpath import exists as exists
54
from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, overload
65

76
_T = TypeVar("_T")
@@ -40,6 +39,7 @@ else:
4039
# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes
4140
# So, fall back to Any
4241
def commonprefix(m: Sequence[AnyPath]) -> Any: ...
42+
def exists(path: AnyPath) -> bool: ...
4343
def lexists(path: AnyPath) -> bool: ...
4444

4545
# These return float if os.stat_float_times() == True,

mypy/typeshed/stdlib/@python2/typing.pyi

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ from types import CodeType, FrameType, TracebackType
55
# Definitions of special type checking related constructs. Their definitions
66
# are not used, so their value does not matter.
77

8-
overload = object()
98
Any = object()
109

1110
class TypeVar:
@@ -40,6 +39,7 @@ Final: _SpecialForm = ...
4039
_F = TypeVar("_F", bound=Callable[..., Any])
4140

4241
def final(f: _F) -> _F: ...
42+
def overload(f: _F) -> _F: ...
4343

4444
Literal: _SpecialForm = ...
4545
# TypedDict is a (non-subscriptable) special form.
@@ -63,11 +63,9 @@ _KT_co = TypeVar("_KT_co", covariant=True) # Key type covariant containers.
6363
_VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers.
6464
_T_contra = TypeVar("_T_contra", contravariant=True) # Ditto contravariant.
6565
_TC = TypeVar("_TC", bound=Type[object])
66-
_C = TypeVar("_C", bound=Callable[..., Any])
6766

68-
no_type_check = object()
69-
70-
def no_type_check_decorator(decorator: _C) -> _C: ...
67+
def no_type_check(f: _F) -> _F: ...
68+
def no_type_check_decorator(decorator: _F) -> _F: ...
7169

7270
# Type aliases and type constructors
7371

@@ -492,4 +490,4 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta):
492490
def NewType(name: str, tp: Type[_T]) -> Type[_T]: ...
493491

494492
# This itself is only available during type checking
495-
def type_check_only(func_or_cls: _C) -> _C: ...
493+
def type_check_only(func_or_cls: _F) -> _F: ...

0 commit comments

Comments
 (0)