mirror of https://github.com/pybind/pybind11.git
Compare commits
6 Commits
d25eb5e0d3
...
7775595943
Author | SHA1 | Date |
---|---|---|
gentlegiantJGC | 7775595943 | |
Hintay | 1f8b4a7f1a | |
gentlegiantJGC | 14dbbce6bd | |
gentlegiantJGC | 862b807adf | |
gentlegiantJGC | 2bf09e21db | |
gentlegiantJGC | 260961b78d |
|
@ -1010,11 +1010,19 @@ struct handle_type_name<weakref> {
|
|||
};
|
||||
template <>
|
||||
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 <>
|
||||
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 <>
|
||||
struct handle_type_name<obj_attr_accessor> {
|
||||
|
@ -1570,9 +1578,9 @@ class argument_loader {
|
|||
using indices = make_index_sequence<sizeof...(Args)>;
|
||||
|
||||
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>
|
||||
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:
|
||||
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)
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class Args : public args {
|
||||
using args::args;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class KWArgs : public kwargs {
|
||||
using kwargs::kwargs;
|
||||
};
|
||||
|
||||
class anyset : public object {
|
||||
public:
|
||||
PYBIND11_OBJECT(anyset, object, PyAnySet_Check)
|
||||
|
|
|
@ -274,10 +274,6 @@ function(pybind11_add_module target_name)
|
|||
target_link_libraries(${target_name} PRIVATE pybind11::embed)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
target_link_libraries(${target_name} PRIVATE pybind11::windows_extras)
|
||||
endif()
|
||||
|
||||
# -fvisibility=hidden is required to allow multiple modules compiled against
|
||||
# different pybind versions to work properly, and for some features (e.g.
|
||||
# py::module_local). We force it on everything inside the `pybind11`
|
||||
|
|
Loading…
Reference in New Issue