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

add_on_binder_for_namespace: place custom code after generated one #86

Open
simleo opened this issue Nov 7, 2019 · 1 comment
Open

Comments

@simleo
Copy link
Contributor

simleo commented Nov 7, 2019

Currently add_on_binder_for_namespace places the call to the function containing the custom manual bindings before binder-generated code. This means that the custom code cannot do several things, including:

  • Bind a class that's a subclass of an automatically bound class, since that class is not yet known
  • Set pybind11 default args to automatically bound types, since they haven't been registered yet

Thus, if there is no special reason to place the custom code before the generated one, it seems useful to do the opposite, so that the custom code can take advantage of what's already present in the generated one.

@lyskov
Copy link
Member

lyskov commented Nov 17, 2019

@simleo i see your point. If i remember correctly there was a technical reason that made placing namespace binding on top, - i will see if it possible refactor this.

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

No branches or pull requests

2 participants