mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-28 22:02:43 +00:00
revert bac to __annotations__
This commit is contained in:
parent
10d7b05ec4
commit
6dff59f0c9
@ -2567,13 +2567,7 @@ str_attr_accessor object_api<D>::doc() const {
|
|||||||
|
|
||||||
template <typename D>
|
template <typename D>
|
||||||
str_attr_accessor object_api<D>::annotations() const {
|
str_attr_accessor object_api<D>::annotations() const {
|
||||||
// Create dict automatically
|
|
||||||
|
|
||||||
#if !defined(PYPY_VERSION) && PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 9
|
|
||||||
str_attr_accessor annotations_dict = attr("__dict__").attr("__annotations__");
|
|
||||||
#else
|
|
||||||
str_attr_accessor annotations_dict = attr("__annotations__");
|
str_attr_accessor annotations_dict = attr("__annotations__");
|
||||||
#endif
|
|
||||||
// Create dict automatically
|
// Create dict automatically
|
||||||
if (!isinstance<dict>(annotations_dict)) {
|
if (!isinstance<dict>(annotations_dict)) {
|
||||||
annotations_dict = dict();
|
annotations_dict = dict();
|
||||||
|
Loading…
Reference in New Issue
Block a user