GeezerVison is showing github.com — gh-109802: removed inaccessible code from complexobject.c by skirpichev · Pull Request #109642 · python/cpython
Conversation
skirpichev
commented
Sep 21, 2023
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
- c_powu: L189 (c_powu() called with n < 100 and mask can't overflow)
- complex_hash: L459, L462 (in current implementation of hashing, -1 is reserved)
- complex_richcompare: L643, L669 (TO_COMPLEX calls are redundant)
- complex_subtype_from_string: L892 (complex_subtype_from_string() helper called only on L949 with unicode object at v)
- actual_complex_new: L960 (PyComplex_Check can't be true here), L960 (test added)
- complex_new_impl: L1028 (test added)
- complex_new_impl: L1034 (here r is not a complex subtype, hence above try_complex_special_method() call was unsuccessful)
- complex_new_impl: L1068 (here r is a complex subtype, hence own_r==1)
- complex_from_number: L1150 (test added)
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
* _Py_c_pow: L134 (this case goes to c_powi() due to L523), L139
// line numbers wrt to 54fbfa8
skirpichev
changed the title
Increase test coverage for complexobject.c
gh-109802: Increase test coverage for complexobject.c
Sep 24, 2023
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Please could one of the core developers watching this PR remove the request for my review? Thank you!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@picnixz, this is quite old PR with a bunch of nitpicks. I would appreciate if you take a look.
|
picnixz reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
picnixz
picnixz approved these changes
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|