Skip to content

Commit

Permalink
skip typevar
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Jul 26, 2024
1 parent d1dc670 commit fd7d4d0
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions include/pybind11/typing.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,33 +130,33 @@ class TypeVar : public object {
// NameWrapper(const char *name) { attr("__name__") = name; }
// };

template <typename T>
class TypeVarObject : public object {
PYBIND11_OBJECT_DEFAULT(TypeVarObject, object, PyObject_Type)
using object::object;
TypeVarObject(const char *name) {
attr("__name__") = name;
attr("__bound__") = object();
attr("__bound__").attr("__name__") = pybind11::detail::make_caster<T>::name;
attr("__constraints__") = pybind11::make_tuple();
}
// TypeVarObject(const char *name, py::typing::Tuple<pybind11::type, pybind11::ellipse> tuple){
// attr("__name__") = name;
// attr("__bound__") = py::none();
// attr("__constraints__") = tuple;
// }
};
// template <typename T>
// class TypeVarObject : public object {
// PYBIND11_OBJECT_DEFAULT(TypeVarObject, object, PyObject_Type)
// using object::object;
// TypeVarObject(const char *name) {
// attr("__name__") = name;
// attr("__bound__") = object();
// attr("__bound__").attr("__name__") = pybind11::detail::make_caster<T>::name;
// attr("__constraints__") = pybind11::make_tuple();
// }
// // TypeVarObject(const char *name, py::typing::Tuple<pybind11::type, pybind11::ellipse> tuple){
// // attr("__name__") = name;
// // attr("__bound__") = py::none();
// // attr("__constraints__") = tuple;
// // }
// };

template <>
class TypeVarObject : public object {
PYBIND11_OBJECT_DEFAULT(TypeVarObject, object, PyObject_Type)
using object::object;
TypeVarObject(const char *name) {
attr("__name__") = name;
attr("__bound__") = py::none();
attr("__constraints__") = pybind11::make_tuple();
}
};
// template <>
// class TypeVarObject : public object {
// PYBIND11_OBJECT_DEFAULT(TypeVarObject, object, PyObject_Type)
// using object::object;
// TypeVarObject(const char *name) {
// attr("__name__") = name;
// attr("__bound__") = py::none();
// attr("__constraints__") = pybind11::make_tuple();
// }
// };

class ParamSpec : public object {
PYBIND11_OBJECT_DEFAULT(ParamSpec, object, PyObject_Type)
Expand Down

0 comments on commit fd7d4d0

Please sign in to comment.