lebrice / SimpleParsing

Simple, Elegant, Typed Argument Parsing with argparse
MIT License
430 stars 52 forks source link

Consider using typing_inspect, to reduce overhead in maintaining own implementation #17

Closed Wooza closed 4 years ago

Wooza commented 4 years ago

I'm currently working on a project that also makes heavy use of type hints. From what I have seen, the internal API of the typing module is still changed quite often. One of the maintainers of the typing module also has a neat library which provides a more stable API to the typing internals. I suggest to take a look at typing_inspect to avoid accessing internal fields like __args__ and __origin__ directly. This should reduce implementation overhead and make the library more stable when new python versions are released.

lebrice commented 4 years ago

Thanks a lot for posting! Interesting proposition. The only potential "downside" I can think of for adding this is that until now this package didn't have any external dependencies (besides dataclasses for python=3.6.x). I'll check-out their API and test it out, and I'll get back to you in a few days. Should be pretty simple to do, also.