Typo fix in class.md

This commit is contained in:
messense 2017-06-27 21:25:41 +08:00
parent b36e75e307
commit 379f178dfb
No known key found for this signature in database
GPG Key ID: BB41A8A2C716CCA9
1 changed files with 3 additions and 4 deletions

View File

@ -22,7 +22,7 @@ struct MyClass {
The above example generates the following implementations for `MyClass` struct
```ignore
```rust,ignore
impl PyTypeInfo for MyClass { ... }
impl PyTypeObject for MyClass { ... }
impl PyObjectWithToken for MyClass { ... }
@ -50,7 +50,7 @@ impl MyClass {
#[new]
fn __new__(cls: &PyType, ...) -> PyResult<Py<MyClass>> {
cls.tokne().init(|token| {
cls.token().init(|token| {
MyClass {
num: 10,
debug: False,
@ -174,8 +174,8 @@ impl MyClass {
}
}
```
From python prespective `method2`, in above example, does not accept any arguments.
From python prespective `method2`, in above example, does not accept any arguments.
## Class methods
@ -227,7 +227,6 @@ impl MyClass {
To specify custom `__call__` method for custom class, call method needs to be annotated
with `#[call]` attribute. Arguments of the method are speficied same as for instance method.
```rust
#[py::methods]
impl MyClass {