SIGN IN SIGN UP

gh-143886: Ensure function annotations are returned in order of definition (#143888)

Ensure function annotations are returned in order of definition

Previously, when getting type annotations of a function, normal
arguments were returned before positional-only ones in the dictionary.
Since `functools.singledispatch` relies on this ordering being correct
to dispatch based on the type of the first argument, this issue was
causing incorrect registrations for functions with positional-only
arguments.

This commit updates how annotations are generated so that
positional-only arguments are generated and added to the dictionary
before normal arguments.
C
Carey Metcalfe committed
cb339d3c9eaeedb6e541a36560b8a21567158e25
Parent: ab45919
Committed by GitHub <noreply@github.com> on 4/15/2026, 1:24:28 PM