style: pre-commit fixes

This commit is contained in:
pre-commit-ci[bot] 2024-07-26 14:22:40 +00:00
parent c6ba82cbba
commit 960d4bcd95
2 changed files with 8 additions and 8 deletions

View File

@ -127,9 +127,7 @@ class TypeVar : public object {
class NameWrapper : public object { class NameWrapper : public object {
PYBIND11_OBJECT_DEFAULT(TypeVarObject, object, PyObject_Type) PYBIND11_OBJECT_DEFAULT(TypeVarObject, object, PyObject_Type)
using object::object; using object::object;
NameWrapper(const char *name){ NameWrapper(const char *name) { attr("__name__") = name; }
attr("__name__") = name;
}
} }
template <typename T> template <typename T>

View File

@ -925,14 +925,16 @@ TEST_SUBMODULE(pytypes, m) {
#endif #endif
struct TypeVarObject {}; struct TypeVarObject {};
py::class_<TypeVarObject>(m, "TypeVarObject").type_params() = py::make_tuple(py::typing::TypeVarObject<int>("T")); py::class_<TypeVarObject>(m, "TypeVarObject").type_params()
= py::make_tuple(py::typing::TypeVarObject<int>("T"));
struct ParamSpec {}; struct ParamSpec {};
py::class_<ParamSpec>(m, "ParamSpec").type_params() = py::make_tuple(py::typing::ParamSpec("P")); py::class_<ParamSpec>(m, "ParamSpec").type_params()
= py::make_tuple(py::typing::ParamSpec("P"));
struct TypeVarTuple {}; struct TypeVarTuple {};
py::class_<TypeVarTuple>(m, "TypeVarTuple").type_params() = py::make_tuple(py::typing::TypeVarTuple("T")); py::class_<TypeVarTuple>(m, "TypeVarTuple").type_params()
= py::make_tuple(py::typing::TypeVarTuple("T"));
struct NoTypeParams {}; struct NoTypeParams {};
struct TypeParams {}; struct TypeParams {};