Apply suggestions from code review

- Style

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
This commit is contained in:
Sergey Kvachonok 2021-04-07 08:23:43 +03:00 committed by GitHub
parent 88849bd96b
commit e8a277e1ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -61,7 +61,7 @@ Each method corresponds to Python's `self.attr`, `self.attr = value` and `del se
### Emulating numeric types
The [`PyNumberProtocol`] trait allows to emulate [numeric types](https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types).
The [`PyNumberProtocol`] trait can be implemented to emulate [numeric types](https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types).
* `fn __add__(lhs: impl FromPyObject, rhs: impl FromPyObject) -> PyResult<impl ToPyObject>`
* `fn __sub__(lhs: impl FromPyObject, rhs: impl FromPyObject) -> PyResult<impl ToPyObject>`
@ -143,10 +143,10 @@ Other:
### Emulating sequential containers (such as lists or tuples)
The [`PySequenceProtocol`] trait allows to emulate
The [`PySequenceProtocol`] trait can be implemented to emulate
[sequential container types](https://docs.python.org/3/reference/datamodel.html#emulating-container-types).
For a sequence, the allowable keys should be the integers _k_ for which _0 <= k < N_,
For a sequence, the keys are the integers _k_ for which _0 <= k < N_,
where _N_ is the length of the sequence.
* `fn __len__(&self) -> PyResult<usize>`