Updated py::capsule type hint to use new types.CapsuleType (#5567)

This commit is contained in:
Tim Ohliger 2025-03-18 19:29:57 +01:00 committed by GitHub
parent dfe7e65b45
commit 9f08625d60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -305,7 +305,7 @@ public:
template <typename T>
using cast_op_type = void *&;
explicit operator void *&() { return value; }
static constexpr auto name = const_name("capsule");
static constexpr auto name = const_name("types.CapsuleType");
private:
void *value = nullptr;
@ -1281,7 +1281,7 @@ struct handle_type_name<type> {
};
template <>
struct handle_type_name<capsule> {
static constexpr auto name = const_name("capsule");
static constexpr auto name = const_name("types.CapsuleType");
};
template <>
struct handle_type_name<ellipsis> {

View File

@ -41,7 +41,7 @@ def test_pointers(msg):
msg(excinfo.value)
== """
get_void_ptr_value(): incompatible function arguments. The following argument types are supported:
1. (arg0: capsule) -> int
1. (arg0: types.CapsuleType) -> int
Invoked with: [1, 2, 3]
"""