Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Wraps transaction into separate class #213
Wraps transaction into separate class #213
Changes from 2 commits
e8038fa
fcbe9ac
42a35f9
592768e
b06494c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Nit: Default
commit
toFalse
. This way the commit action is explicitly called out.Context: If Google Play was more forgiving, I'd be okay to keep it as is, but reverting a change is impossible in some cases.
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.
Should we leave it explicit? I definitely don't believe that we should default it to
true
, but I think that requiring devs to specify a value is a good thing. It reduces confusion when devs don't realize that the parameter is possible ("why aren't my changes being applied?"), but requires an explicittrue
if devs are confident that they want to apply their changesThere 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.
In addition to avoiding footguns, defaulting this param has another pro to me.
commit
becomes akwarg
, so if it's an incentive to call it this way:rather than that way:
While, I agree it doesn't prevent the latter from happening. It's just an incentive.
To me, the latter is more dangerous and can lead newcomers to just copy and paste an existing (and working) line while having very few context about what this
True
is about. I think the damage done by a committed transaction outweighs the damage done by the "why aren't my changes being applied" scenario. Moreover, the reason why changes aren't applied is explicitly called out in the logs. So guessing the fix shouldn't be a hard task.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 think I've found the best of both words: I've forced it to be a kwarg without giving it a default value:
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.
Oooooooh! TIL https://www.python.org/dev/peps/pep-3102/
That's an excellent finding 😃. Thanks!