gh-111673: Refactor test_float/complex.py (split out support classes) by skirpichev · Pull Request #110956 · python/cpython
Taken from python#26827 Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
skirpichev
changed the title
Refactor test_float/complex.py (split out support classes)
gh-111673: Refactor test_float/complex.py (split out support classes)
@AlexWaygood, does this require news? I think - not.
Yeah, we can skip it for this one, good call
@sobolevn, maybe you can review this as an issue author? Let me know if it's better to split this to several pull requests.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that I like this change. It changes a lot of tests for little value (it's just refactoring). But I'm not against this change.
@serhiy-storchaka: Do you have an opinion on this change?
| class FloatSubclass(float): | ||
| pass | ||
|
|
||
| class OtherFloatSubclass(float): |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it's worth it to have OtherFloatSubclass and OtherComplexSubclass in this number_helper module.
I already proposed something similar in #84310. But it only defined classes with a single special method (__index__, __float__), which could be used in a number of tests. I am not sure that it is worth to share simple or too specialized classes like IntSubclass or WithIntAndIndex.