Skip to content

Conversation

@hugtalbot
Copy link
Contributor

This PR is a fork of #457 authored by @damienmarchal
We urgently needed to merge it while fixing the conflicts on a branch which was protected.

Closes #457

damienmarchal and others added 9 commits September 23, 2024 14:59
…nows about them.

The problem:
Depending on the definition order of the binded classes, there may have
incorrect types if Base is useing BaseData... but BaseData is only binded after Base.

The PR propose a solution for that using a decidcated "forward" registration patter.
…definition' into pr-typehint-example-how-to-fix-definition
It should be completed if ones want more feature than just class declaration
@hugtalbot hugtalbot requested a review from bakpaul January 9, 2025 10:16
@hugtalbot hugtalbot changed the title 202501 fork 457 [fork] Fix type forward declaration in the bindings Jan 9, 2025
@damienmarchal
Copy link
Contributor

Ok I see.

@bakpaul bakpaul merged commit cb4e6bf into sofa-framework:master Jan 9, 2025
3 checks passed
bakpaul pushed a commit that referenced this pull request Jan 9, 2025
* Example on how to fix pybind11 type forward declaration so stubgens knows about them.

The problem:
Depending on the definition order of the binded classes, there may have
incorrect types if Base is useing BaseData... but BaseData is only binded after Base.

The PR propose a solution for that using a decidcated "forward" registration patter.

* Add binding for BaseClass

It should be completed if ones want more feature than just class declaration

* Generalize the pybind11 forward declaration of classes.

---------

Co-authored-by: Damien Marchal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants