Skip to content

Commit 9f08625

Browse files
authored
Updated py::capsule type hint to use new types.CapsuleType (#5567)
1 parent dfe7e65 commit 9f08625

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/pybind11/cast.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ class type_caster<void> : public type_caster<void_type> {
305305
template <typename T>
306306
using cast_op_type = void *&;
307307
explicit operator void *&() { return value; }
308-
static constexpr auto name = const_name("capsule");
308+
static constexpr auto name = const_name("types.CapsuleType");
309309

310310
private:
311311
void *value = nullptr;
@@ -1281,7 +1281,7 @@ struct handle_type_name<type> {
12811281
};
12821282
template <>
12831283
struct handle_type_name<capsule> {
1284-
static constexpr auto name = const_name("capsule");
1284+
static constexpr auto name = const_name("types.CapsuleType");
12851285
};
12861286
template <>
12871287
struct handle_type_name<ellipsis> {

tests/test_opaque_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_pointers(msg):
4141
msg(excinfo.value)
4242
== """
4343
get_void_ptr_value(): incompatible function arguments. The following argument types are supported:
44-
1. (arg0: capsule) -> int
44+
1. (arg0: types.CapsuleType) -> int
4545
4646
Invoked with: [1, 2, 3]
4747
"""

0 commit comments

Comments
 (0)