Commit 81d6cf2
[PyROOT] Get names and types of all overloads' signature
Expose two new attributes of a CPPOverload object on the Python side,
namely `func_overloads_names` and `func_overloads_types`. The first
returns a dictionary with all the input parameter names for all the
overloads, the second returns a dictionary with the types of the return
and input parameters for all the overloads. An example:
```python
import ROOT
from pprint import pprint
ROOT.gInterpreter.Declare("""
int foo(int a, float b);
int foo(int a);
float foo(float b);
double foo(int a, float b, double c);
""")
pprint(ROOT.foo.func_overloads_names)
pprint(ROOT.foo.func_overloads_types)
```
Output:
```
{'double ::foo(int a, float b, double c)': ('a', 'b', 'c'),
'float ::foo(float b)': ('b',),
'int ::foo(int a)': ('a',),
'int ::foo(int a, float b)': ('a', 'b')}
{'double ::foo(int a, float b, double c)': {'input_types': ('int',
'float',
'double'),
'return_type': 'double'},
'float ::foo(float b)': {'input_types': ('float',), 'return_type': 'float'},
'int ::foo(int a)': {'input_types': ('int',), 'return_type': 'int'},
'int ::foo(int a, float b)': {'input_types': ('int', 'float'),
'return_type': 'int'}}
```1 parent 6afd6e8 commit 81d6cf2
File tree
4 files changed
+125
-1
lines changed- bindings/pyroot/cppyy/CPyCppyy/src
4 files changed
+125
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1055 | 1055 | | |
1056 | 1056 | | |
1057 | 1057 | | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
1058 | 1122 | | |
1059 | 1123 | | |
1060 | 1124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
285 | 291 | | |
286 | 292 | | |
287 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
288 | 342 | | |
289 | 343 | | |
290 | 344 | | |
| |||
582 | 636 | | |
583 | 637 | | |
584 | 638 | | |
| 639 | + | |
| 640 | + | |
585 | 641 | | |
586 | 642 | | |
587 | 643 | | |
| |||
1250 | 1306 | | |
1251 | 1307 | | |
1252 | 1308 | | |
1253 | | - | |
| 1309 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
0 commit comments