autowrap
autowrap copied to clipboard
Use inheritance instead of assignment for "attached" classes
Instead of:
class Outer:
Inner = _Inner
class _Inner:
...
We could do
class Outer:
class Inner(_Inner): pass
class _Inner
...
This would help generate documentation with sphinx autodoc—otherwise the documentation of Outer.Inner is "alias of _Inner", which is kind of useless. Maybe there is another way with autodoc but this would be a quick fix. Not sure about runtime penalties though.
Ideally, we would have the full definition inside Outer but I think Cython does not really support that yet.