`NameError` from `inspect.signature()` or `obj.__annotations__` for types present only in `TYPE_CHECKING` block
Summary The issue arises when using inspect.signature() or obj.__annotations__ to get a function signature as a string, resulting in a NameError. This error occurs because the type TracebackType is only defined within a TYPE_CHECKING block, which is not evaluated at runtime. Root Cause The root cause of this issue is that the TYPE_CHECKING block is … Read more