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

Allow providing a default to optional() #65

Closed
unode opened this issue Sep 6, 2022 · 2 comments · Fixed by #66
Closed

Allow providing a default to optional() #65

unode opened this issue Sep 6, 2022 · 2 comments · Fixed by #66

Comments

@unode
Copy link
Contributor

unode commented Sep 6, 2022

It would be convenient to have optional(default_value) which would return default_value instead of None.
This can be seen as complementary to result(default_value) that always return a fixed value.

unode added a commit to unode/parsy that referenced this issue Sep 6, 2022
@spookylukey
Copy link
Member

Yep, that sounds like a good improvement.

@unode
Copy link
Contributor Author

unode commented Sep 6, 2022

PR done in #66

unode added a commit to unode/parsy that referenced this issue Sep 6, 2022
unode added a commit to unode/parsy that referenced this issue Sep 6, 2022
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 a pull request may close this issue.

2 participants