◐ Shell
clean mode source ↗

gh-111673: Refactor test_float/complex.py (split out support classes) by skirpichev · Pull Request #110956 · python/cpython

@skirpichev

@skirpichev skirpichev commented

Oct 17, 2023

edited by bedevere-app Bot

Loading

Taken from python#26827

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>

@skirpichev skirpichev changed the title Refactor test_float/complex.py (split out support classes) gh-111673: Refactor test_float/complex.py (split out support classes)

Nov 3, 2023

@skirpichev

This comment was marked as resolved.

@AlexWaygood

@AlexWaygood, does this require news? I think - not.

Yeah, we can skip it for this one, good call

@skirpichev

This comment was marked as outdated.

@skirpichev

@sobolevn, maybe you can review this as an issue author? Let me know if it's better to split this to several pull requests.

@skirpichev

vstinner

vstinner

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.

@serhiy-storchaka

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.

@skirpichev

Ok, thanks.

I think, I haven't enough motivation to push it further.