The typing spec says that overload function definitions and the implementation must be contiguous.
While there are pros and cons to this (I can see how defining a helper like _div right above the implementation is handy) it does seem like a reasonable rule for readability. A PR to Pyrefly adding this missing check flagged this kernel in mypy_primer, so I figured I'd put up a fix since the next release will flag it.