Closed ringohoffman closed 7 months ago
I found this while running on taichi:
taichi
class Program: def create_ndarray(self, layout: Layout = <Layout.NULL: 2>) -> Ndarray: ...
This expression could be made syntactically correct just by extracting out the __str__ repr of the enum value like:
__str__
class Program: def create_ndarray(self, layout: Layout = Layout.NULL) -> Ndarray: ...
Should we do this by default?
Actually it seems like this is already done:
https://github.com/sizmailov/pybind11-stubgen/blob/adbd6a335795b96227e78b3483cafb278f1c7a77/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/enum.pyi#L63-L65
It seems like
--enum-class-locations="Layout:taichi._lib.core.taichi_python"
was the key! Should have read the error message closer!
I found this while running on
taichi
:This expression could be made syntactically correct just by extracting out the
__str__
repr of the enum value like:Should we do this by default?