-
Notifications
You must be signed in to change notification settings - Fork 104
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
docker.legacy_build(pull="never")
is treated as pull=True
#466
Comments
Yes I think that would be helpful. I would be happy to get such a PR :) EDIT: Maybe we should consider using beartype for this. That would avoid some complexity in our arguments. Maybe we should decorate our public api with this? |
That sounds like an interesting idea, I hadn't come across beartype before - what enigmatic docs! |
@gabrieldemarmiesse would the following suffice?
I asserted that |
The issue with adding the beartype decorator used in non-public APIs is that the error messages won't be clean for the users. The error message will talk about a type mismatch in an internal function and it won't be obvious what caused this. I tend to think that decorating public apis functions with beartype would make error messages clearer from a user perspective. |
That makes lots of sense, thanks for the explanation! I'm going to read more |
It seems that APIs that only accept booleans will be interpreted as a boolean value even if another type is given. This is particularly confusing in the case of
docker.legacy_build(pull: bool)
, which is subtly different todocker.run(pull: str)
. Would it be worth doing some arg type validation, at least in theCommand.add_flag()
method?The text was updated successfully, but these errors were encountered: