mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 11:51:28 +08:00
Change argument type in random.shuffle (python/typeshed#4255) (#4260)
Fixes #4255
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
# ----- random classes -----
|
||||
|
||||
import _random
|
||||
from typing import AbstractSet, Any, Callable, Iterator, List, Protocol, Sequence, TypeVar, Union, overload
|
||||
from typing import AbstractSet, Any, Callable, Iterator, List, MutableSequence, Protocol, Sequence, TypeVar, Union, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_T_co = TypeVar('_T_co', covariant=True)
|
||||
@@ -29,7 +29,7 @@ class Random(_random.Random):
|
||||
def randrange(self, start: int, stop: int, step: int = ...) -> int: ...
|
||||
def randint(self, a: int, b: int) -> int: ...
|
||||
def choice(self, seq: Sequence[_T]) -> _T: ...
|
||||
def shuffle(self, x: List[Any], random: Callable[[], None] = ...) -> None: ...
|
||||
def shuffle(self, x: MutableSequence[Any], random: Callable[[], None] = ...) -> None: ...
|
||||
def sample(self, population: _Sampleable[_T], k: int) -> List[_T]: ...
|
||||
def random(self) -> float: ...
|
||||
def uniform(self, a: float, b: float) -> float: ...
|
||||
@@ -60,7 +60,7 @@ def randrange(stop: int) -> int: ...
|
||||
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: List[Any], random: Callable[[], float] = ...) -> None: ...
|
||||
def shuffle(x: MutableSequence[Any], random: Callable[[], float] = ...) -> None: ...
|
||||
def sample(population: _Sampleable[_T], k: int) -> List[_T]: ...
|
||||
def random() -> float: ...
|
||||
def uniform(a: float, b: float) -> float: ...
|
||||
|
||||
Reference in New Issue
Block a user