NDFrame.align is annotated as def align(self: NDFrameT, other: NDFrameT, ...) -> NDFrameT: but actually other does not need to match self and it usually returns a tuple[Self, type(other)]. The "usually" is because when broadcast_axis==1 and self.ndim != other.ndim it returns tuple[DataFrame, DataFrame] (xref #51856 id like to deprecate this special case).

I tried annotating this correctly and got 40ish complaints e.g pandas/core/generic.py:8994: error: Cannot determine type of "index" [has-type]

Comment From: twoertwein

When does align return a non-tuple? Both _align_frame and _align_series always return a tuple, so I don't see how align can return anything but a tuple.

Comment From: jbrockmendel

It always returns a tuple. the annotation is wrong