Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better type handling in Arguments #27

Closed
edornd opened this issue Feb 28, 2023 · 2 comments
Closed

Better type handling in Arguments #27

edornd opened this issue Feb 28, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@edornd
Copy link
Owner

edornd commented Feb 28, 2023

Describe the bug
The current type handling using a dictionary is a bit bug-prone.
E.g., date datetime or time are not included in NAMES as they do not represent primitive types strictly speaking, howver this introduces a two-fold problem.

  1. including them in the type dictionary, makes argparse attempt the parsing itself instead of forwarding it to pydantic
  2. not including them does not allow the definition of more descriptive metavars (i.e., DATE instead of TEXT)

To Reproduce
Simply defining a List[date] is enough.

Expected behavior
Date/time objects (and other complex standard and non-standard data types) should be "acknowledged", meaning that, if possible, argparse should be aware of them (at the very least using an ad-hoc metavar) but pydantic should take care of the heavy lifting.

@edornd edornd added the enhancement New feature or request label Feb 28, 2023
@edornd edornd self-assigned this Feb 28, 2023
@edornd
Copy link
Owner Author

edornd commented Feb 28, 2023

Related to PR #26

@edornd
Copy link
Owner Author

edornd commented Mar 19, 2023

Satisfied so far, might reopen later, idk.

@edornd edornd closed this as completed Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant