mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 16:13:53 +00:00
Merge branch 'master' into smart_holder
This commit is contained in:
commit
9ae7f87fb6
@ -377,7 +377,7 @@ template <> struct process_attribute<is_new_style_constructor> : process_attribu
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline void process_kw_only_arg(const arg &a, function_record *r) {
|
inline void process_kw_only_arg(const arg &a, function_record *r) {
|
||||||
if (!a.name || strlen(a.name) == 0)
|
if (!a.name || a.name[0] == '\0')
|
||||||
pybind11_fail("arg(): cannot specify an unnamed argument after an kw_only() annotation");
|
pybind11_fail("arg(): cannot specify an unnamed argument after an kw_only() annotation");
|
||||||
++r->nargs_kw_only;
|
++r->nargs_kw_only;
|
||||||
}
|
}
|
||||||
|
@ -444,7 +444,7 @@ protected:
|
|||||||
signatures += it->signature;
|
signatures += it->signature;
|
||||||
signatures += "\n";
|
signatures += "\n";
|
||||||
}
|
}
|
||||||
if (it->doc && strlen(it->doc) > 0 && options::show_user_defined_docstrings()) {
|
if (it->doc && it->doc[0] != '\0' && options::show_user_defined_docstrings()) {
|
||||||
// If we're appending another docstring, and aren't printing function signatures, we
|
// If we're appending another docstring, and aren't printing function signatures, we
|
||||||
// need to append a newline first:
|
// need to append a newline first:
|
||||||
if (!options::show_function_signatures()) {
|
if (!options::show_function_signatures()) {
|
||||||
|
@ -380,7 +380,11 @@ struct type_caster<std::variant<Ts...>> : variant_caster<std::variant<Ts...>> {
|
|||||||
PYBIND11_NAMESPACE_END(detail)
|
PYBIND11_NAMESPACE_END(detail)
|
||||||
|
|
||||||
inline std::ostream &operator<<(std::ostream &os, const handle &obj) {
|
inline std::ostream &operator<<(std::ostream &os, const handle &obj) {
|
||||||
|
#ifdef PYBIND11_HAS_STRING_VIEW
|
||||||
|
os << str(obj).cast<std::string_view>();
|
||||||
|
#else
|
||||||
os << (std::string) str(obj);
|
os << (std::string) str(obj);
|
||||||
|
#endif
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user