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

For unions, handle string types last #209

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

brentyi
Copy link
Owner

@brentyi brentyi commented Dec 4, 2024

Examples:

  • For arg: Optional[str] and arg: str | None, --arg None will create a None object instead of a string.
    • This was already happening.
  • For arg: str | bool, --arg True will create a boolean instead of a string.
    • This is new.
  • For arg: str | int, integers will be created when possible instead of strings.
    • This is new.

Questions raised:

  • Should we also handle arg: tuple[str, ...] | int?
  • How about Optional[list[str]]?

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.78%. Comparing base (af0ae1e) to head (37dc485).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #209   +/-   ##
=======================================
  Coverage   99.78%   99.78%           
=======================================
  Files          28       28           
  Lines        2302     2302           
=======================================
  Hits         2297     2297           
  Misses          5        5           
Flag Coverage Δ
unittests 99.78% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant