Removes the hacky ReprObj thing that was used as a hack in tricky type annotation translation cases.
This lets code later down the stub emission code path introspect the actual types, since it preserves types and not just the formatted representation of the type.
A nice side effect of the refactor is that it better preserves original types as well, by not translating typing.Optional into typing.Union[None, ...] etc.
Since this only touches type_stub emission it should be relatively safe
Removes the hacky
ReprObj
thing that was used as a hack in tricky type annotation translation cases.This lets code later down the stub emission code path introspect the actual types, since it preserves types and not just the formatted representation of the type.
A nice side effect of the refactor is that it better preserves original types as well, by not translating
typing.Optional
intotyping.Union[None, ...]
etc.Since this only touches type_stub emission it should be relatively safe