-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
Isolate the _curses extension module #101714
Comments
@erlend-aasland, don't mind if I work on this one? :) |
Sure, go ahead; I don't have time for this at the moment. |
There might be a WIP PR open by me. Feel free to pick up where I left. |
@erlend-aasland, sorry, I can't find any. It's not a problem though, because I almost finished my own work and will submit a PR soon (I hope so). |
Nice. You can ping me and |
I'm not sure it is worth it isolating I think we should consider just leaving it as it is. |
Yeah, the status quo is: it won't get imported in isolated subinterpreters. That should be fine. |
Yep. Closing as wont-fix. |
Feature or enhancement
Isolate the
_curses
extension module. This means turning most global variables into module state variables.Globals in the
_curses
extension module:setupterm()
has been called to initialiseterminfo
initscr()
has been called to initialise cursesstart_color()
has been called to initialise color usageThere is also a capsule with a C API. I'm not sure if this needs special handling wrt. PEP-489, but the _curses C API exposes three of the global variables1 directly. That said, those three variables are all guards for curses specific initialisation; it may make sense to keep these variables global; I don't know yet. The capsule C API also uses the _curses exception object (
curses.error
). Altering or removing the _curses C API is a breaking change and must follow the deprecation cycle of PEP-387.Apart from the capsule C API issues, converting the remaining global variables to module state variables seem to be an easy task; most of them are used in either module functions or class methods. We can store the state in the
PyCursesWindow_Type
object for easy access and minimal churn.Pitch
This is needed in order to support a per-interpreter GIL.
Previous discussion
https://github.com/ericsnowcurrently/multi-core-python/wiki/0-The-Plan
Linked PRs
_curses
extension module #104732Footnotes
initialised_setupterm
,initialisedcolors
, andinitialised
↩The text was updated successfully, but these errors were encountered: