27 Feb
2022
27 Feb
'22
12:45 p.m.
As you can guess, I don't know how type checkers work -- so my question: given the following annotated function: def foobar(spam, eggs, ham='tasty'): pass If it were annotated via decorator [^1]: @annotate( spam=str, eggs=int, ham=str, ) Would mypy and the others recognize those annotations? -- ~Ethan~ [^1]: the decorator would populate the function's `__annotations__` variable.