-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Move cpp_function
to its own header file for further refactoring
#2807
base: master
Are you sure you want to change the base?
Conversation
if (!some_args) some_args = true; | ||
else msg += ", "; | ||
try { | ||
msg += repr(args_[ti]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason this was changed from pybind11::repr
to repr
? It should be perfectly fine, since args_[ti]
has a type from the pybind11
namespace, so even ADL would only find pybind11::repr
, just curious if the change was intentional.
I'd like to first get some context on this refactoring, before moving things around. Can you please create an issue with what you're planning to do and, more importantly, why, so that we can discuss? Anything that's refactoring something this big should be discussed with maintainers, before just throwing a series of PRs at us, since it has implications for existing PRs and forks, and shouldn't just be done "for fun". Take the interaction with #2445 (first proposed/discussed in #2322) as an example of why this needs to be coordinated. |
@YannickJadoul Yeah I agree we should probably discuss about this in advance... Let me open an issue later about the motivations and intentions... |
@bstaletic @YannickJadoul I just opened #2810 to describe the problem I ran into, the refactors I want to do and the potential problems. It is more like a RFC so feel free to give me suggestions there. |
@lqf96, thanks, I saw! When I (soon) pull together my courage to think about this, I'll have a closer look and comment in that PR :-) |
Description
Move
cpp_function
to its own header filepybind11/detail/function.h
, because I find it hard to refactorcpp_function
aspybind11/pybind11.h
is too long. I specifically choose thedetail
directory as I'd like to splitcpp_function
into two parts in the long term: one part (inpybind11
namespace) being anobject
wrapper around a C++ function and another part (indetail
namespace) dispatching the actual function call. I'll provide more details about these refactoring in upcoming PRs. This PR also moves signature and docstring generation ofcpp_function
to separate functions.