binder
binder copied to clipboard
add_on_binder_for_namespace: place custom code after generated one
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.
@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.