Skip to content

Instantly share code, notes, and snippets.

@dabeaz
Created February 3, 2013 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dabeaz/4702829 to your computer and use it in GitHub Desktop.
Save dabeaz/4702829 to your computer and use it in GitHub Desktop.
From Python-3.3 source code, Python/pystate.c. Note the comment: I have no recollection of requesting this feature, but it must have been important at the time ;-).
/* Routines for advanced debuggers, requested by David Beazley.
Don't use unless you know what you are doing! */
PyInterpreterState *
PyInterpreterState_Head(void)
{
return interp_head;
}
PyInterpreterState *
PyInterpreterState_Next(PyInterpreterState *interp) {
return interp->next;
}
PyThreadState *
PyInterpreterState_ThreadHead(PyInterpreterState *interp) {
return interp->tstate_head;
}
PyThreadState *
PyThreadState_Next(PyThreadState *tstate) {
return tstate->next;
}
@eyaltrabelsi
Copy link

@dabeaz can you explain this dark magic ?:))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment