From: Federico Caselli Date: Tue, 18 Oct 2022 17:57:19 +0000 (+0200) Subject: Improve proxy methods with the changes from the abandoned X-Git-Tag: rel_2_0_0b2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3668889426bde1cfe31aca387a9c54fe56a66ff7;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Improve proxy methods with the changes from the abandoned I5c7f172e5224fa08d0675160ac919d0b045a26eb Change-Id: Ieb7971297f959fd635a4627bd93154e28ef0ef2b --- diff --git a/tools/generate_proxy_methods.py b/tools/generate_proxy_methods.py index fd20707844..85f8b23208 100644 --- a/tools/generate_proxy_methods.py +++ b/tools/generate_proxy_methods.py @@ -154,16 +154,19 @@ def _grab_overloads(fn): current_ov[:] = [] break - fn_match = re.match(r"^ (?:async )?def (.*)\($", line) + fn_match = re.match(r"^ (?: )?(?:async )?def (.*)\($", line) if fn_match and fn_match.group(1) != fn.__name__: current_ov[:] = [] break - ov_match = re.match(r"^ @overload$", line) + ov_match = re.match(r"^ (?: )?@overload$", line) if ov_match: output.append("".join(reversed(current_ov))) current_ov[:] = [] + if re.match(r"^ if (?:typing\.)?TYPE_CHECKING:", line): + output.append(line) + output.reverse() return output