diff --git a/.gitignore b/.gitignore index aa4e90943ffa..c1113eab637a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ __pycache__ /env*/ docs/build/ docs/source/_build +mypyc/doc/_build *.iml /out/ .venv*/ diff --git a/mypyc/doc/dict_operations.rst b/mypyc/doc/dict_operations.rst index 89dd8149a970..eb2e5221c518 100644 --- a/mypyc/doc/dict_operations.rst +++ b/mypyc/doc/dict_operations.rst @@ -43,6 +43,8 @@ Methods * ``d.keys()`` * ``d.values()`` * ``d.items()`` +* ``d.copy()`` +* ``d.clear()`` * ``d1.update(d2: dict)`` * ``d.update(x: Iterable)`` diff --git a/mypyc/doc/native_classes.rst b/mypyc/doc/native_classes.rst index 424e3e174c9d..8987d55d759b 100644 --- a/mypyc/doc/native_classes.rst +++ b/mypyc/doc/native_classes.rst @@ -38,7 +38,7 @@ can be assigned to (similar to using ``__slots__``):: def method(self) -> None: self.z = "x" - o = Cls() + o = Cls(0) print(o.x, o.y) # OK o.z = "y" # OK o.extra = 3 # Error: no attribute "extra" @@ -90,7 +90,7 @@ You need to install ``mypy-extensions`` to use ``@mypyc_attr``: Class variables --------------- -Class variables much be explicitly declared using ``attr: ClassVar`` +Class variables must be explicitly declared using ``attr: ClassVar`` or ``attr: ClassVar[]``. You can't assign to a class variable through an instance. Example:: diff --git a/mypyc/doc/str_operations.rst b/mypyc/doc/str_operations.rst index 7b1d497c28aa..5420c8af7d31 100644 --- a/mypyc/doc/str_operations.rst +++ b/mypyc/doc/str_operations.rst @@ -27,6 +27,8 @@ Methods * ``s1.endswith(s2: str)`` * ``s.join(x: Iterable)`` +* ``s.replace(old: str, new: str)`` +* ``s.replace(old: str, new: str, count: int)`` * ``s.split()`` * ``s.split(sep: str)`` * ``s.split(sep: str, maxsplit: int)``