mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 08:03:55 +00:00
Compare commits
6 Commits
d25eb5e0d3
...
7775595943
Author | SHA1 | Date | |
---|---|---|---|
|
7775595943 | ||
|
1f8b4a7f1a | ||
|
14dbbce6bd | ||
|
862b807adf | ||
|
2bf09e21db | ||
|
260961b78d |
@ -1010,11 +1010,19 @@ struct handle_type_name<weakref> {
|
|||||||
};
|
};
|
||||||
template <>
|
template <>
|
||||||
struct handle_type_name<args> {
|
struct handle_type_name<args> {
|
||||||
static constexpr auto name = const_name("*args");
|
static constexpr auto name = const_name("*args: typing.Any");
|
||||||
|
};
|
||||||
|
template <typename T>
|
||||||
|
struct handle_type_name<Args<T>> {
|
||||||
|
static constexpr auto name = const_name("*args: ") + make_caster<T>::name;
|
||||||
};
|
};
|
||||||
template <>
|
template <>
|
||||||
struct handle_type_name<kwargs> {
|
struct handle_type_name<kwargs> {
|
||||||
static constexpr auto name = const_name("**kwargs");
|
static constexpr auto name = const_name("**kwargs: typing.Any");
|
||||||
|
};
|
||||||
|
template <typename T>
|
||||||
|
struct handle_type_name<KWArgs<T>> {
|
||||||
|
static constexpr auto name = const_name("**kwargs: ") + make_caster<T>::name;
|
||||||
};
|
};
|
||||||
template <>
|
template <>
|
||||||
struct handle_type_name<obj_attr_accessor> {
|
struct handle_type_name<obj_attr_accessor> {
|
||||||
@ -1570,9 +1578,9 @@ class argument_loader {
|
|||||||
using indices = make_index_sequence<sizeof...(Args)>;
|
using indices = make_index_sequence<sizeof...(Args)>;
|
||||||
|
|
||||||
template <typename Arg>
|
template <typename Arg>
|
||||||
using argument_is_args = std::is_same<intrinsic_t<Arg>, args>;
|
using argument_is_args = std::is_base_of<args, intrinsic_t<Arg>>;
|
||||||
template <typename Arg>
|
template <typename Arg>
|
||||||
using argument_is_kwargs = std::is_same<intrinsic_t<Arg>, kwargs>;
|
using argument_is_kwargs = std::is_base_of<kwargs, intrinsic_t<Arg>>;
|
||||||
// Get kwargs argument position, or -1 if not present:
|
// Get kwargs argument position, or -1 if not present:
|
||||||
static constexpr auto kwargs_pos = constexpr_last<argument_is_kwargs, Args...>();
|
static constexpr auto kwargs_pos = constexpr_last<argument_is_kwargs, Args...>();
|
||||||
|
|
||||||
|
@ -2216,6 +2216,16 @@ class kwargs : public dict {
|
|||||||
PYBIND11_OBJECT_DEFAULT(kwargs, dict, PyDict_Check)
|
PYBIND11_OBJECT_DEFAULT(kwargs, dict, PyDict_Check)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
class Args : public args {
|
||||||
|
using args::args;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
class KWArgs : public kwargs {
|
||||||
|
using kwargs::kwargs;
|
||||||
|
};
|
||||||
|
|
||||||
class anyset : public object {
|
class anyset : public object {
|
||||||
public:
|
public:
|
||||||
PYBIND11_OBJECT(anyset, object, PyAnySet_Check)
|
PYBIND11_OBJECT(anyset, object, PyAnySet_Check)
|
||||||
|
@ -274,10 +274,6 @@ function(pybind11_add_module target_name)
|
|||||||
target_link_libraries(${target_name} PRIVATE pybind11::embed)
|
target_link_libraries(${target_name} PRIVATE pybind11::embed)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
target_link_libraries(${target_name} PRIVATE pybind11::windows_extras)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# -fvisibility=hidden is required to allow multiple modules compiled against
|
# -fvisibility=hidden is required to allow multiple modules compiled against
|
||||||
# different pybind versions to work properly, and for some features (e.g.
|
# different pybind versions to work properly, and for some features (e.g.
|
||||||
# py::module_local). We force it on everything inside the `pybind11`
|
# py::module_local). We force it on everything inside the `pybind11`
|
||||||
|
Loading…
Reference in New Issue
Block a user