Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs should mention that it's not possible to derive Rust classes from Python ones #3415

Closed
smheidrich opened this issue Aug 25, 2023 · 1 comment · Fixed by #3418
Closed

Comments

@smheidrich
Copy link
Contributor

smheidrich commented Aug 25, 2023

From the answers to #296 I gather that it's not currently possible to have Rust-implemented pyclasses be subclasses of regular Python classes. As far as I can tell, the docs don't mention this explicitly and the relevant section only talks about classes that are available as Rust types (like user-defined pyclasses and the ones that come with PyO3).

In my opinion, it wouldn't hurt to mention this explicitly in the docs, both in the text and in the reference table entry for extends. Someone else also requested this in #296 (comment).

I thought that maybe the reason it isn't mentioned is that this is a limitation of Python extension types in general rather than one of PyO3, but Python's docs on the issue say only that deriving extension types from built-in rather than custom Python types is the easiest option, not that it's the only one.

@davidhewitt
Copy link
Member

Discussion of the intent to support this is in #991. It's mostly a question of balancing this against many other priorities for PyO3. I would be happy to have this supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants