-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-91288: Move set.test_c_api
to _testcapimodule.test_set
#32133
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
Conversation
|
I don't see the point of this. It seem like unnecessary code churn that just moves related pieces of code farther apart. The method is only visible in debug builds which is the entire point of the having the test method.
If it isn't in a release build and isn't documented as public , then it isn't public. |
Thank you for the review! I had a sleep on it and now I agree that the initial rationale gives no benefit being just about aestetics. However, I believe that the PR is still useful. All core classes except I'm aware that initially it wasn't an option for
Initially I got an impression that everything not starting with an underscore and discoverable via |
@rhettinger There is no sense to keep some test cases separately from the rest of the C API tests after their dependency on private functions is eliminated. |
set.test_c_api
to _testcapimodule.test_set
set.test_c_api
to _testcapimodule.test_set
Thank for the suggestion but I'm going to decline. AFAICT no real user problem is being solved here. Also, as the maintainer of the code, it is a bit easier for me to have it all in one place. |
Actually, I don't object. I agree that unnavigable ~8k lines of |
Currently, tests for PySet/PyFrozenSet C API are defined in Objects/setobject.c and available via
set.test_c_api()
.Moving them to, for example,
_testcapi
gives the following advantanges:an internal, CPython-specific method stops being available in a public interface of the set class
CPython already has tests grouped into dedicated packages
the target package undefines NDEBUG thus making asserts available in release builds
a user may choose to omit the tests from a build not carrying them around
a file of 2.5k lines of codes becomes 152 lines smaller.
Closes gh-91288.