Samuel Marks <samuelma...@gmail.com> added the comment:
Hmm, debugging my test and I was able to replicate it with this smaller one: ``` from ast import FunctionDef, arguments, Load, Name, AnnAssign, Store, BinOp, Add, unparse unparse(FunctionDef(args=arguments(args=[], defaults=[], kw_defaults=[], kwarg=None, kwonlyargs=[], posonlyargs=[], vararg=None), body=[AnnAssign(annotation='int', simple=1, target=Name(ctx=Store(), id='res'), value=BinOp(left=Name(ctx=Load(), id='a'), op=Add(), right=Name(ctx=Load(), id='b')))], decorator_list=[], name='sum', returns=None, lineno=None, type_comment=None)) ``` Which for some reason has made the `annotation` a `str` rather than `Name`. So I think it's my bug then? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44825> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com