Nested functions with generic type annotations using python 3.12 syntax is not supported #10736
Open
1 task done
Labels
bug
Something isn't working
Describe the bug
The easiest way to explain this issue is with an example of a concrete failing function:
In this case gradio errors out with
NameError: name 'T' is not defined
because the occurrence of T in the inner function is not recognized.A workaround is to use the old pre-3.12 way where
T
is defined as a stand alone variable like this:while this works it is not the recommended way of defining generics anymore, so I think the new way should be supported
Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
System Info
Severity
I can work around it
The text was updated successfully, but these errors were encountered: