Skip to content

Commit

Permalink
Merge pull request #3418 from smheidrich/mention-inability-to-derive-…
Browse files Browse the repository at this point in the history
…from-python-classes-in-docs

Mention inability to subclass Python classes in docs
  • Loading branch information
davidhewitt authored Aug 29, 2023
2 parents abc942a + 2855b9d commit 0de1714
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion guide/src/class.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ Consult the table below to determine which type your constructor should return:

By default, `object`, i.e. `PyAny` is used as the base class. To override this default,
use the `extends` parameter for `pyclass` with the full path to the base class.
Currently, only classes defined in Rust and builtins provided by PyO3 can be inherited
from; inheriting from other classes defined in Python is not yet supported
([#991](https://github.com/PyO3/pyo3/issues/991)).


For convenience, `(T, U)` implements `Into<PyClassInitializer<T>>` where `U` is the
base class of `T`.
Expand Down Expand Up @@ -340,7 +344,7 @@ impl SubSubClass {
# });
```

You can also inherit native types such as `PyDict`, if they implement
You can inherit native types such as `PyDict`, if they implement
[`PySizedLayout`]({{#PYO3_DOCS_URL}}/pyo3/type_object/trait.PySizedLayout.html).
This is not supported when building for the Python limited API (aka the `abi3` feature of PyO3).

Expand Down

0 comments on commit 0de1714

Please sign in to comment.