Across the codebase, handle the case a keyword argument is provided but set to None#1965
Conversation
NoneNone
|
This seems fine, if you want to go through the code more like you mentioned. I think what I'd really like is to stop using |
|
That one seems to have broken a behavior. Besides that change, were there any others? Let me know when this is ready for merge. |
|
My last commit broke a test. This is due to the fact that
I think this may be accidental behavior but it's not senseless: settings Nonetheless, I noticed that if you provide @davidism I think it's better to handle this issue in another PR eventually. Thus, I'd revert my last commit here. What do you think? |
|
Sounds good to me, I'll merge this one after you remove that commit. |
|
I reverted the commit, I didn't remove it. This is ready to be merged.
I searched for |
3fc37c1 to
f85a35d
Compare
In several points, Click relies exclusively on the following check to verify if an argument
arg_namehas been provided:arg_name in attrs. Then it assumes thatattrs[arg_name] is not None. This PR is about treatingNonevalues inattrsas "not provided" too.attrs[key] is not Nonejust becausekey in attrs#1959 and similar issues in command decorators (see commit messages).There are probably other points in the codebase that do the same thing. If you intend to merge this, I'll go on and search more in depth. I'll also add a test and a changelog entry.
Checklist:
CHANGES.rstsummarizing the change and linking to the issue... versionchanged::entries in any relevant code docs.pre-commithooks and fix any issues.pytestandtox, no tests failed.