Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upReturn the error codes instead of implicitly returning None #13344
Comments
|
Please make a comment here if you intend to work on this issue. Thank you! |
|
Great! |
|
I wanted to work on this issue as well :) |
|
Sorry, @bubbles231 claimed this first. Feel free to poke other unclaimed easy issues, or comment here (or ping us at the |
|
I meant that they both have similar boolean evaluation (i.e) how the if None: print 'Hello'
# doesn't print anything
if 0: print 'Hello'
# doesn't print anythingHence, there's no great reason to prefer |
|
un assign me please |
|
@bubbles231 Thanks for letting us know! @uber1geek It's yours then! :) |
|
@wafflespeanut Return result seems good, I was thinking if we just make it an empty value. it will evaluate to false and that solves the issue imo. |
|
I'm not sure what you're trying to get at here. This is what I think is being proposed: return call(...) |
|
@uber1geek Any updates on this? |
|
I'd like to claim this. Sent a PR. |
Return the error codes instead of implicitly returning None See #13344 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #13344 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring without logic changes, 0 is falsey as None <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13513) <!-- Reviewable:end -->
Return the error codes instead of implicitly returning None See #13344 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #13344 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring without logic changes, 0 is falsey as None <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13513) <!-- Reviewable:end -->
…turning None (from nivekuil:master); r=Wafflespeanut See servo/servo#13344 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #13344 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring without logic changes, 0 is falsey as None <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 0e950c0ba5ba96ab629a21e8bdeba0795e320316
…turning None (from nivekuil:master); r=Wafflespeanut See servo/servo#13344 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #13344 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring without logic changes, 0 is falsey as None <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 0e950c0ba5ba96ab629a21e8bdeba0795e320316
…turning None (from nivekuil:master); r=Wafflespeanut See servo/servo#13344 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #13344 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring without logic changes, 0 is falsey as None <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 0e950c0ba5ba96ab629a21e8bdeba0795e320316 UltraBlame original commit: c2e967be59e9324e8b7c9e34f67233f5fb83386d
…turning None (from nivekuil:master); r=Wafflespeanut See servo/servo#13344 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #13344 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring without logic changes, 0 is falsey as None <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 0e950c0ba5ba96ab629a21e8bdeba0795e320316 UltraBlame original commit: c2e967be59e9324e8b7c9e34f67233f5fb83386d
…turning None (from nivekuil:master); r=Wafflespeanut See servo/servo#13344 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #13344 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring without logic changes, 0 is falsey as None <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 0e950c0ba5ba96ab629a21e8bdeba0795e320316 UltraBlame original commit: c2e967be59e9324e8b7c9e34f67233f5fb83386d
Some of the methods in
testing_commands.pyhave a returning pattern like,Instead of doing that check and implicitly returning
None, we could just return the result, since0andNonehave the same boolean evaluation in python.Code:
python/servo/testing_commands.py