edornd / argdantic

Typed command line interfaces with argparse and pydantic
MIT License
38 stars 4 forks source link

Enums and Literals are not parsed correctly #14

Closed edornd closed 1 year ago

edornd commented 1 year ago

Since the convert function is called before the choice verification, the Literal options are parsed with value only (and rightly so). This however introduces a problem in the __contains__, where the check happens: enums should be checked against their name, while literals using the value. To avoid weird edge cases, we check values only even in the case of Enum.

edornd commented 1 year ago

Solved, should be solid for the time being.