swansonk14 / typed-argument-parser

Typed argument parser for Python
MIT License
505 stars 40 forks source link

Fixed bug with incorrect type annotation of class instance created by tapify #119

Closed shorie000 closed 1 year ago

shorie000 commented 1 year ago

When class is set to tapify, the created instance is returned as type[class], not type class.

For example, if I create an ABC class and input it to the tapify function, the return type is type[ABC], not ABC.

image

So change input type of tapify from Union[Callable[[InputType], OutputType], OutputType] to Union[Callable[[InputType], OutputType], Type[OutputType]]

image
martinjm97 commented 1 year ago

Thank you for the fix! It looks great!

--JK