Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Mar 8, 2024
1 parent 05c42bd commit 72e99f9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/pybind11/typing.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ struct handle_type_name<typing::Tuple<>> {
template <typename T>
struct handle_type_name<typing::Tuple<T, ellipsis>> {
// PEP 484 specifies this syntax for a variable-length tuple
static constexpr auto name = const_name("tuple[") + make_caster<T>::name + const_name(", ...]");
static constexpr auto name
= const_name("tuple[") + make_caster<T>::name + const_name(", ...]");
};

template <typename K, typename V>
Expand Down
3 changes: 2 additions & 1 deletion tests/test_pytypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,8 @@ TEST_SUBMODULE(pytypes, m) {

m.def("annotate_tuple_float_str", [](const py::typing::Tuple<py::float_, py::str> &) {});
m.def("annotate_tuple_empty", [](const py::typing::Tuple<> &) {});
m.def("annotate_tuple_variable_length", [](const py::typing::Tuple<py::float_, py::ellipsis> &) {});
m.def("annotate_tuple_variable_length",
[](const py::typing::Tuple<py::float_, py::ellipsis> &) {});
m.def("annotate_dict_str_int", [](const py::typing::Dict<py::str, int> &) {});
m.def("annotate_list_int", [](const py::typing::List<int> &) {});
m.def("annotate_set_str", [](const py::typing::Set<std::string> &) {});
Expand Down
3 changes: 2 additions & 1 deletion tests/test_pytypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,8 @@ def test_tuple_empty_annotations(doc):

def test_tuple_variable_length_annotations(doc):
assert (
doc(m.annotate_tuple_variable_length) == "annotate_tuple_variable_length(arg0: tuple[float, ...]) -> None"
doc(m.annotate_tuple_variable_length)
== "annotate_tuple_variable_length(arg0: tuple[float, ...]) -> None"
)


Expand Down

0 comments on commit 72e99f9

Please sign in to comment.