Skip to content

Commit

Permalink
[mypyc] Small documentation updates (#10184)
Browse files Browse the repository at this point in the history
Here are a few updates/fixes after a read through the mypyc docs.

For the corresponding primitive method updates, see:

* str.replace: #10088
* dict.copy: #9721
* dict.clear: #9724
  • Loading branch information
thomasjohns authored Mar 8, 2021
1 parent 4adb5e4 commit 28034cc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ __pycache__
/env*/
docs/build/
docs/source/_build
mypyc/doc/_build
*.iml
/out/
.venv*/
Expand Down
2 changes: 2 additions & 0 deletions mypyc/doc/dict_operations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Methods
* ``d.keys()``
* ``d.values()``
* ``d.items()``
* ``d.copy()``
* ``d.clear()``
* ``d1.update(d2: dict)``
* ``d.update(x: Iterable)``

Expand Down
4 changes: 2 additions & 2 deletions mypyc/doc/native_classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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[<type>]``. You can't assign to a class variable
through an instance. Example::

Expand Down
2 changes: 2 additions & 0 deletions mypyc/doc/str_operations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)``
Expand Down

0 comments on commit 28034cc

Please sign in to comment.