mirror of
https://github.com/pybind/pybind11.git
synced 2025-03-22 08:46:06 +00:00
Add generic signature for overloads
This commit is contained in:
parent
13b22bf4f6
commit
0e04fdf3f6
@ -295,6 +295,13 @@ protected:
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
/* Create a nice pydoc rec including all signatures and
|
/* Create a nice pydoc rec including all signatures and
|
||||||
docstrings of the functions in the overload chain */
|
docstrings of the functions in the overload chain */
|
||||||
|
if (chain) {
|
||||||
|
// First a generic signature
|
||||||
|
signatures += rec->name;
|
||||||
|
signatures += "(*args, **kwargs)\n";
|
||||||
|
signatures += "Overloaded function.\n\n";
|
||||||
|
}
|
||||||
|
// Then specific overload signatures
|
||||||
for (auto it = chain_start; it != nullptr; it = it->next) {
|
for (auto it = chain_start; it != nullptr; it = it->next) {
|
||||||
if (chain)
|
if (chain)
|
||||||
signatures += std::to_string(++index) + ". ";
|
signatures += std::to_string(++index) + ". ";
|
||||||
|
Loading…
Reference in New Issue
Block a user