mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import _random
|
||||
from typing import Any, Callable, Iterator, List, MutableSequence, Protocol, Sequence, TypeVar, overload
|
||||
from typing import Any, Callable, Iterator, MutableSequence, Protocol, Sequence, TypeVar, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
@@ -22,7 +22,7 @@ class Random(_random.Random):
|
||||
def randint(self, a: int, b: int) -> int: ...
|
||||
def choice(self, seq: Sequence[_T]) -> _T: ...
|
||||
def shuffle(self, x: MutableSequence[Any], random: Callable[[], None] = ...) -> None: ...
|
||||
def sample(self, population: _Sampleable[_T], k: int) -> List[_T]: ...
|
||||
def sample(self, population: _Sampleable[_T], k: int) -> list[_T]: ...
|
||||
def random(self) -> float: ...
|
||||
def uniform(self, a: float, b: float) -> float: ...
|
||||
def triangular(self, low: float = ..., high: float = ..., mode: float = ...) -> float: ...
|
||||
@@ -52,7 +52,7 @@ def randrange(start: int, stop: int, step: int = ...) -> int: ...
|
||||
def randint(a: int, b: int) -> int: ...
|
||||
def choice(seq: Sequence[_T]) -> _T: ...
|
||||
def shuffle(x: MutableSequence[Any], random: Callable[[], float] = ...) -> None: ...
|
||||
def sample(population: _Sampleable[_T], k: int) -> List[_T]: ...
|
||||
def sample(population: _Sampleable[_T], k: int) -> list[_T]: ...
|
||||
def random() -> float: ...
|
||||
def uniform(a: float, b: float) -> float: ...
|
||||
def triangular(low: float = ..., high: float = ..., mode: float = ...) -> float: ...
|
||||
|
||||
Reference in New Issue
Block a user