MLIR
15.0.0git
|
Provides a facility like py::class_ for defining a new class in a scope, but this allows extension of an arbitrary Python class, defining methods on it is a similar way. More...
#include "mlir/Bindings/Python/PybindAdaptors.h"
Public Member Functions | |
pure_subclass (py::handle scope, const char *derivedClassName, const py::object &superClass) | |
template<typename Func , typename... Extra> | |
pure_subclass & | def (const char *name, Func &&f, const Extra &... extra) |
template<typename Func , typename... Extra> | |
pure_subclass & | def_property_readonly (const char *name, Func &&f, const Extra &... extra) |
template<typename Func , typename... Extra> | |
pure_subclass & | def_staticmethod (const char *name, Func &&f, const Extra &... extra) |
template<typename Func , typename... Extra> | |
pure_subclass & | def_classmethod (const char *name, Func &&f, const Extra &... extra) |
py::object | get_class () const |
Protected Attributes | |
py::object | superClass |
py::object | thisClass |
Provides a facility like py::class_ for defining a new class in a scope, but this allows extension of an arbitrary Python class, defining methods on it is a similar way.
Classes defined in this way are very similar to if defined in Python in the usual way but use Pybind11 machinery to do it. These are not "real" Pybind11 classes but pure Python classes with no relation to a concrete C++ class.
Derived from a discussion upstream: https://github.com/pybind/pybind11/issues/1193 (plus a fair amount of extra curricular poking) TODO: If this proves useful, see about including it in pybind11.
Definition at line 240 of file PybindAdaptors.h.
|
inline |
Definition at line 242 of file PybindAdaptors.h.
|
inline |
Definition at line 255 of file PybindAdaptors.h.
|
inline |
Definition at line 289 of file PybindAdaptors.h.
References value.
Referenced by populateDialectQuantSubmodule(), and populateDialectSparseTensorSubmodule().
|
inline |
Definition at line 264 of file PybindAdaptors.h.
Referenced by populateDialectQuantSubmodule().
|
inline |
Definition at line 276 of file PybindAdaptors.h.
References value.
|
inline |
Definition at line 302 of file PybindAdaptors.h.
|
protected |
Definition at line 305 of file PybindAdaptors.h.
|
protected |
Definition at line 306 of file PybindAdaptors.h.