mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-20 08:38:26 +08:00
constructors: Fix defaulted TypeVars (#7965)
From the list in https://github.com/microsoft/pyright/issues/3501
This commit is contained in:
@@ -91,7 +91,10 @@ else:
|
||||
def sort_dictionary(d, key: Any | None = ...): ...
|
||||
|
||||
class OrderedSet(set[_T], Generic[_T]):
|
||||
def __init__(self, d: Iterable[_T] | None = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, d: None = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, d: Iterable[_T]) -> None: ...
|
||||
def add(self, element: _T) -> None: ...
|
||||
def remove(self, element: _T) -> None: ...
|
||||
def insert(self, pos: int, element: _T) -> None: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from collections.abc import Callable, Iterator, Mapping
|
||||
from typing import Any, ClassVar, Generic, TypeVar
|
||||
from typing import Any, ClassVar, Generic, TypeVar, overload
|
||||
from typing_extensions import ParamSpec, final
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -11,7 +11,10 @@ _P = ParamSpec("_P")
|
||||
|
||||
@final
|
||||
class ContextVar(Generic[_T]):
|
||||
def __init__(self, name: str, *, default: _T = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, name: str) -> None: ...
|
||||
@overload
|
||||
def __init__(self, name: str, *, default: _T) -> None: ...
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
def get(self, default: _T = ...) -> _T: ...
|
||||
|
||||
Reference in New Issue
Block a user