Description
If you do something like the following:
class Base:
def __init__(self) -> None:
pass
class SomeMixin:
if TYPE_CHECKING:
# forward declare __init__
__init__ = Base.__init__ # type:ignore[assignment]
Autoapi will crash in the mapping step when trying to access overloads
on the class node, this is presumably because the following check does not guard against non-method nodes:
sphinx-autoapi/autoapi/_objects.py
Lines 452 to 464 in b9b2a95
I couldn't really figure out why this didn't cause a crash prior to 3.3.0, but at the very least it should be fairly simple to avoid a crash here, by adding an additional guard. Doing something more sophisticated would require more work. But I don't think it is necessary, considering this is a really rare hacky workaround and in fact I no longer needed to use it in the places that caused the crash.
But it still can't hurt to avoid this crash in the future, since it was a pain to debug.