binder icon indicating copy to clipboard operation
binder copied to clipboard

add_on_binder_for_namespace: place custom code after generated one

Open simleo opened this issue 6 years ago • 4 comments

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 avatar Nov 07 '19 15:11 simleo

@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.

lyskov avatar Nov 17 '19 23:11 lyskov