From 181e38b5514c861390bacd5798622af7df57b089 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 26 Jul 2017 22:40:47 -0700 Subject: [PATCH] add guid entry for base class --- guide/src/class.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guide/src/class.md b/guide/src/class.md index d8dcaf4d..2dfbe4cf 100644 --- a/guide/src/class.md +++ b/guide/src/class.md @@ -98,6 +98,18 @@ Some rules of `new` method Usually, `T` will be `MyType`. +## Inheritance + +By default `PyObject` is used as default base class. To override default base class +`base` parameter to `py::class` needs to be used. Value is full path to base class. + +```rust +#[py::class(base=asyncio.protocols.AbstractEventLoop)] +class MyEventLoop { + ... +} +``` + ## Object properties Instance's `__dict__` attributes is not supported by pyo3 library. But it is