diff --git a/include/pybind11/pytypes.h b/include/pybind11/pytypes.h index 7fed214d43..b3996f9cf0 100644 --- a/include/pybind11/pytypes.h +++ b/include/pybind11/pytypes.h @@ -2569,10 +2569,9 @@ template // Always a dict // https://docs.python.org/3/howto/annotations.html#accessing-the-annotations-dict-of-an-object-in-python-3-9-and-older object object_api::annotations() const { - if (isinstance(derived())){ + if (isinstance(derived())) { return getattr(getattr(derived(), "__dict__"), "__annotations__", dict()); - } - else{ + } else { return getattr(derived(), "__annotations__", dict()); } }