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

Rename parse_string_unsafe to parse_string_liberally so it's less intimidating #101

Open
tbielawa opened this issue Feb 13, 2023 · 2 comments
Labels
Milestone

Comments

@tbielawa
Copy link
Owner

In the 2.0 update bug #99, it was brought up that parse_string_unsafe can have negative side effects

Using an "unsafe" function will be flagged in every code review and will cause the reviewer to dig into the implementation to verify that this is really "safe" to use

Originally posted by @FelixSchwarz in #99 (comment)

I'm proposing _liberally because definition no. 2 when I looked it up is:

in a way that is not precise or strictly literal; loosely.

which feels accurate for what it does.

Thoughts?

@tbielawa
Copy link
Owner Author

tbielawa commented Feb 13, 2023

I suppose there are other ways to approach this.

Get rid of the _unsafe / _liberally functions completely and add a kwarg to the standard parse_string function which allows it to apply the less strict parsing logic.

@FelixSchwarz
Copy link

I never saw "liberally" in an API. Personally I sometimes use "guess_...". However I like something like a strict=True/False parameter even more. The default would be strict parsing but users could use a more "liberal" one.

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

No branches or pull requests

2 participants