mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
random: match seed type in __init__ (#11942)
This commit is contained in:
@@ -41,7 +41,10 @@ _T = TypeVar("_T")
|
||||
|
||||
class Random(_random.Random):
|
||||
VERSION: ClassVar[int]
|
||||
def __init__(self, x: Any = None) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __init__(self, x: int | float | str | bytes | bytearray | None = None) -> None: ... # noqa: Y041
|
||||
else:
|
||||
def __init__(self, x: Any = None) -> None: ...
|
||||
# Using other `seed` types is deprecated since 3.9 and removed in 3.11
|
||||
# Ignore Y041, since random.seed doesn't treat int like a float subtype. Having an explicit
|
||||
# int better documents conventional usage of random.seed.
|
||||
|
||||
Reference in New Issue
Block a user