trycast icon indicating copy to clipboard operation
trycast copied to clipboard

eval_type_str: Consider add to public API

Open davidfstr opened this issue 3 years ago • 0 comments

eval_type_str is an internal function of the trycast module that is used to convert a stringified type annotation (like "typing.List") to a type annotation object (like typing.List).

Why expose?

  • This function was mentioned prominently in a PyCon US 2022 Typing Summit presentation. The cat is already out of the bag.
  • Trycast would be the only runtime type checker to expose this kind of functionality (either privately or publicly) to my knowledge. So this function would be a clear differentiating feature.

Tasks

  • [ ] Draft (extensive) tests that probe the eval_type_str function, and its limitations
  • [ ] Add function to API Reference (& Changelog)

davidfstr avatar May 30 '22 14:05 davidfstr