mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-16 21:57:55 +00:00
Merge branch 'pybind:master' into master
This commit is contained in:
commit
ab96a975a9
@ -34,8 +34,9 @@
|
||||
/// further ABI-incompatible changes may be made before the ABI is officially
|
||||
/// changed to the new version.
|
||||
#ifndef PYBIND11_INTERNALS_VERSION
|
||||
# if PY_VERSION_HEX >= 0x030C0000
|
||||
# if PY_VERSION_HEX >= 0x030C0000 || defined(_MSC_VER)
|
||||
// Version bump for Python 3.12+, before first 3.12 beta release.
|
||||
// Version bump for MSVC piggy-backed on PR #4779. See comments there.
|
||||
# define PYBIND11_INTERNALS_VERSION 5
|
||||
# else
|
||||
# define PYBIND11_INTERNALS_VERSION 4
|
||||
|
@ -2014,7 +2014,7 @@ struct enum_base {
|
||||
object type_name = type::handle_of(arg).attr("__name__");
|
||||
return pybind11::str("{}.{}").format(std::move(type_name), enum_name(arg));
|
||||
},
|
||||
name("name"),
|
||||
name("__str__"),
|
||||
is_method(m_base));
|
||||
|
||||
if (options::show_enum_members_docstring()) {
|
||||
|
@ -264,3 +264,8 @@ def test_docstring_signatures():
|
||||
for attr in enum_type.__dict__.values():
|
||||
# Issue #2623/PR #2637: Add argument names to enum_ methods
|
||||
assert "arg0" not in (attr.__doc__ or "")
|
||||
|
||||
|
||||
def test_str_signature():
|
||||
for enum_type in [m.ScopedEnum, m.UnscopedEnum]:
|
||||
assert enum_type.__str__.__doc__.startswith("__str__")
|
||||
|
Loading…
Reference in New Issue
Block a user