-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
PEP 573: Module State Access from C Extension Methods #82968
Comments
Currently, there is not way to access per-module state from the methods of types defined in extension modules. This PEP provides a fix to this issue. PEP-573 - https://www.python.org/dev/peps/pep-0573/ Reference implementation - https://github.com/Dormouse759/cpython/tree/pep-c-rebase_newer |
What can we do to move this forward? I see that the original PR was closed in January. Is there or will there be a new one? Can I help with anything? |
The PEP is listed as accepted, with you as the BDFL-delegate, but it lacks a link to the public acceptance message (usually on pydev list). The PR was not rejected by a core dev but was closed without explanation by the author on the same day the last commits were added. Perhaps OP just gave up getting tests to pass. But they disappear on closes. However, the contribution had been made under the CLA and you or Petr or any other core dev should be able to download it to a local branch, try to whip it into shape, and make a new PR before beta 1, in about a month. Or start from scratch. I cannot test downloading at the moment. Apparently, OP's fork branch has been altered, so that merely reopening is not an option. The OP used force-pushes rather than update merges, and this often creates problems. |
I'm working on the implementation as my time allows, here: encukou#3 . Would it help to create a proper PR for CPython now? That would mean I could no longer do rebases/force-pushes, so the commits would be less readable. But happy to do it if it would help you. |
In PR19982, petr have mentioned that I try to use PEP-573 in functools, I get the error info from testcases: Traceback (most recent call last):
File "/temp/shihai/cpython/Lib/test/test_functools.py", line 109, in test_arg_combinations
p = self.partial(capture)
TypeError: PyType_GetModule: Type 'CPartialSubclass' has no associated module ====================================================================== Traceback (most recent call last):
File "/temp/shihai/cpython/Lib/test/test_functools.py", line 71, in test_attributes
p = self.partial(capture, 1, 2, a=10, b=20)
TypeError: PyType_GetModule: Type 'CPartialSubclass' has no associated module |
I guess I'll need to clarify the documentation here. |
+1, I didn't notice this detail until I got the error.
Thanks, pep have enough info, I need spend sometime to make sure I understand it clearly, Lol~. |
Thanks Victor, Hai Shi, Pablo, Stefan, Dong-hee Na and Mariatta for reviews! I did not put all the details in the documentation because there are still feature gaps. So, a full write-up is now in the informational PEP-630. |
FYI Cython doesn't support this PEP yet: cython/cython#3917 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: