-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-62040: Raise ValueError
on invalid *errors* argument in several codecs
#136611
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
base: main
Are you sure you want to change the base?
Conversation
ValueError
on invalid *errors* parameter in several codecsValueError
on invalid *errors* argument in several codecs
I can see that there's only some changes from last patch: For example, I'd like to remove also |
Ah I forgot about the patch and my grep was too strict, I'll fix all the self.errors cases. |
@@ -8,14 +8,20 @@ | |||
import codecs | |||
import base64 | |||
|
|||
### Codec Helpers | |||
|
|||
def _assert_strict(errors): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe _check_strict
from the original patch would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer assert_strict
since it is closer to what was there before, and it is more obvious, to me at least, that it will fail if errors != 'strict'
, whereas check_strict
, seems like something that will enable more verbose errors or the like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, it's not fully correct to name method assert_something
and don't make any assert
checks or raising an AssertionError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@malemburg which do you prefer? _check_strict
or _assert_strict
assert
for runtime validity checks #62040