-
Notifications
You must be signed in to change notification settings - Fork 110
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
RF: use parse_known_args instead of _parse_known_args #6414
Conversation
parse_known_args seems to be doing some processing which we did not apparently needed. @mih raised concern/question on why we use protected method and there were no comment/rationale left in the code. I have set exit_on_error to False since we do not want to add that error handling behavior since we did not rely on it before Timing on my laptop on this commit $> multitime -n 5 datalad --help-np 1>/dev/null ===> multitime results 1: datalad --help-np Mean Std.Dev. Min Median Max real 1.304 0.026 1.276 1.294 1.353 user 1.232 0.035 1.197 1.221 1.300 sys 0.076 0.010 0.057 0.080 0.085 and on master $> multitime -n 5 datalad --help-np 1>/dev/null ===> multitime results 1: datalad --help-np Mean Std.Dev. Min Median Max real 1.312 0.037 1.270 1.315 1.365 user 1.229 0.032 1.184 1.228 1.265 sys 0.087 0.012 0.072 0.090 0.106 so no notable negative impact (good).
aha -- failures against extensions shine the light on "why/whatfor":
looking at http://github.com/python/cpython/blob/HEAD/Doc/library/argparse.rst
so we could do the switch starting from 3.9. I will add a commit reverting this RF and adding a comment to do whenever 3.9 is minimal version. |
Code Climate has analyzed commit 03645e5 and detected 0 issues on this pull request. View more on Code Climate. |
@jwodder is there a way to instruct auto to not bother about changelog entry at all for a PR? |
@yarikoptic I don't think so. |
Codecov Report
@@ Coverage Diff @@
## master #6414 +/- ##
==========================================
+ Coverage 89.57% 90.01% +0.43%
==========================================
Files 345 345
Lines 43032 43312 +280
==========================================
+ Hits 38545 38986 +441
+ Misses 4487 4326 -161
Continue to review full report at Codecov.
|
Thx for the investigation and leaving this note! |
parse_known_args seems to be doing some processing which we did not
apparently needed. @mih raised concern/question on why we use protected
method and there were no comment/rationale left in the code.
I have set exit_on_error to False since we do not want to add that
error handling behavior since we did not rely on it before
Timing on my laptop on this commit
and on master
so no notable negative impact (good).
🏠 Internal
ArgumentParser.parse_known_args
instead of protected_parse_known_args