-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
gh-109802: removed inaccessible code from complexobject.c #109642
Conversation
* _Py_c_pow: L134 (this case goes to c_powi() due to L523), L139 // line numbers wrt to 54fbfa8
https://docs.python.org/3/library/stdtypes.html#hashing-of-numeric-types Inaccessible cases transformed to asserts.
d270aa6
to
e1c247f
Compare
Partially from python#109642
Partially from python#109642
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.
The PR increases test coverage in two ways:: adding tests and removing some code paths that cannot be reached. The added tests are quite safe to add. The changes to the C code are a bit hard to comprehend, but I checked them and seem valid to me. Also they are guarded by asserts.
Only one comment on a docstring, but otherwise looks good.
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Please could one of the core developers watching this PR remove the request for my review? Thank you! |
@picnixz, this is quite old PR with a bunch of nitpicks. I would appreciate if you take a look. |
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
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.
Final nitpicks that I missed. Otherwise I think it's ok? (I'm not familiar enough with this part of the code but it looks good to me).
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.
Just a question otherwise LGTM.
This comment was marked as off-topic.
This comment was marked as off-topic.
@serhiy-storchaka, I suspect that @mdickinson was -1 on this pr; thus, it should be closed together with the issue. Let me know if it this make sense for you in some form at least partially (e.g. removing useless TO_COMPLEX or useless PyUnicode_Check()). If so, I'll quickly revert the rest. |
If @mdickinson was -1, I am -1 too. This issue already taken up too much of your and my time. Too much for any potential benefits. |
That's only my guess. Anyway, thank you for your time. @picnixz and @eendebakpt, thank for reviews. |
Line numbers are wrt to complexobject.c at 8a284e189673582e2.
Everything (except for memory errors) should be covered by tests in test_complex.py and test_capi/test_complex.py.