Commit 49aa611
committed
Improved errors when inheriting and forgetting to call __init__
If the base class doesn't have a constructor, tell the user that it cannot be
inherited from.
Caveats:
* Doesn't work on PyPy
* If the default instance base was no longer a PyHeapTypeObject this could crash.
* If pybind11_object_init changed in the future, and multiple pybind11 modules are
present, get_internals might return an old version of the function1 parent c676036 commit 49aa611
2 files changed
+24
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
| |||
620 | 626 | | |
621 | 627 | | |
622 | 628 | | |
623 | | - | |
| 629 | + | |
624 | 630 | | |
625 | 631 | | |
626 | 632 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
135 | 150 | | |
136 | 151 | | |
137 | 152 | | |
| |||
0 commit comments