hamilton icon indicating copy to clipboard operation
hamilton copied to clipboard

remove dependency on typing_inspect

Open elijahbenizzy opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. It is lightweight, but not heavily maintained. We should be able to remove the dependency as the python API stabilizes.

I think typing, included in the stdlib, has most of the stuff we need, especially >3.7 (8? 9?). Specifically get_origin

https://github.com/ilevkivskyi/typing_inspect

Describe the solution you'd like We should see what we can use in the stdlib, TBD. We should contribute back anything to python typing module that we can't do.

Describe alternatives you've considered

  • Supporting the typing_inspect module
  • Forking/including it in Hamilton

Additional context Just looking through the code

elijahbenizzy avatar Oct 18 '23 17:10 elijahbenizzy

Note. For Python <= 3.9, the stdlib typing module doesn't define a __name__ attribute for complex types (e.g., Dict[str, int]). Instead, the information is accessed through .__origin__.__name__

zilto avatar Nov 08 '23 22:11 zilto