Skip to content

Commit

Permalink
Updated documentation of multiple inheritence rules (GH-3422)
Browse files Browse the repository at this point in the history
Original change #1927
  • Loading branch information
da-woods committed Mar 21, 2020
1 parent bffa63b commit cdbd792
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/src/userguide/extension_types.rst
Expand Up @@ -327,7 +327,8 @@ when it is deleted.::
Subclassing
=============

An extension type may inherit from a built-in type or another extension type::
If an extension type inherits from other types, the first base class must be
a built-in type or another extension type::

cdef class Parrot:
...
Expand All @@ -342,7 +343,9 @@ extern extension type. If the base type is defined in another Cython module, it
must either be declared as an extern extension type or imported using the
:keyword:`cimport` statement.

An extension type can only have one base class (no multiple inheritance).
Multiple inheritance is supported, however the second and subsequent base
classes must be an ordinary Python class (not an extension type or a built-in
type).

Cython extension types can also be subclassed in Python. A Python class can
inherit from multiple extension types provided that the usual Python rules for
Expand Down

0 comments on commit cdbd792

Please sign in to comment.