Skip to content

Commit

Permalink
style: fix nit suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed Nov 10, 2024
1 parent 09a4992 commit 5366b05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/pybind11/pybind11.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class cpp_function : public function {
has_pos_only_args = any_of<std::is_same<pos_only, Extra>...>::value,
has_arg_annotations = any_of<is_keyword<Extra>...>::value;
constexpr bool has_is_method = any_of<std::is_same<is_method, Extra>...>::value;
// The implicit `self` argument is not present and counted in method definitions.
// The implicit `self` argument is not present and not counted in method definitions.
constexpr bool has_args = cast_in::args_pos >= 0;
constexpr bool is_method_with_self_arg_only = has_is_method && !has_args;
static_assert(has_arg_annotations || !has_kw_only_args,
Expand All @@ -312,7 +312,7 @@ class cpp_function : public function {
|| (/* Allow methods with no arguments `def method(self, /): ...`.
* A method has at least one argument `self`. There can be no
* `py::arg` annotation. E.g. `class.def("method", py::pos_only())`.
* */
*/
is_method_with_self_arg_only))
|| !has_pos_only_args,
"py::pos_only requires the use of argument annotations (for docstrings "
Expand Down

0 comments on commit 5366b05

Please sign in to comment.