Commit 1a5bf295 authored by Tom Niget's avatar Tom Niget

Add various functions to stdlib type hints

parent be810856
......@@ -36,6 +36,7 @@ class str:
def __len__(self) -> int: ...
def __add__(self, other: Self) -> Self: ...
def __mul__(self, other: int) -> Self: ...
def startswith(self, prefix: Self) -> bool: ...
assert len("a")
......@@ -50,14 +51,21 @@ class list(Generic[U]):
def __mul__(self, other: int) -> Self: ...
def __getitem__(self, index: int) -> U: ...
def __setitem__(self, index: int, value: U) -> None: ...
def pop(self, index: int = -1) -> U: ...
def __iter__(self) -> Iterator[U]: ...
def __len__(self) -> int: ...
def append(self, value: U) -> None: ...
assert [1, 2].__iter__()
assert list[int].__iter__
class dict(Generic[U, V]):
def __getitem__(self, key: U) -> V: ...
def __setitem__(self, key: U, value: V) -> None: ...
def __len__(self) -> int: ...
assert(len(["a"]))
......@@ -107,8 +115,10 @@ assert lambda x: [x].__add__
assert next(range(6), None)
class file:
def read(self) -> Task[str]: ...
def read(self, size: int=0) -> Task[str]: ...
def close(self) -> Task[None]: ...
def __enter__(self) -> Self: ...
def __exit__(self) -> Task[bool]: ...
def open(filename: str, mode: str) -> Task[file]: ...
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment