[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2022-04-06 Thread STINNER Victor


STINNER Victor  added the comment:

I would be nice to make the PyThreadState opaque in Python 3.12. IMO it's too 
late for Python 3.11. Hopefully, Cython should be prepared for such change. At 
the beginning, maybe Cython can just use the internal C API, as it does to 
access the internal PyFrameObject structure.

--
versions: +Python 3.11 -Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2021-10-21 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27399
pull_request: https://github.com/python/cpython/pull/29121

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2021-10-13 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-45247: [C API] Add explicit support for Cython to the C API.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2021-09-21 Thread STINNER Victor


STINNER Victor  added the comment:

See bpo-43760 and PR 28498 for a discussion about the PyThreadState.use_tracing 
member.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2021-06-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset db532a09990c837ec1348e6e6bd2719f5d4a8216 by Victor Stinner in 
branch 'main':
bpo-39947: Remove old private trashcan C API functions (GH-26869)
https://github.com/python/cpython/commit/db532a09990c837ec1348e6e6bd2719f5d4a8216


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2021-06-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +25444
pull_request: https://github.com/python/cpython/pull/26869

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2021-06-18 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +iritkatriel
nosy_count: 4.0 -> 5.0
pull_requests: +25372
pull_request: https://github.com/python/cpython/pull/26788

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2021-04-02 Thread STINNER Victor


STINNER Victor  added the comment:

About setting frame local variables, see:

* bpo-42197: Disable automatic update of frame locals during tracing
* bpo-30744: Local variable assignment is broken when combined with threads + 
tracing + closures
* PEP 558: Defined semantics for locals()
  https://www.python.org/dev/peps/pep-0558/

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 166286849048eccadecf02b242dbc4042b780944 by Victor Stinner in 
branch '3.9':
Add symbols of the stable ABI to python3dll.c (GH-23598) (GH-23801)
https://github.com/python/cpython/commit/166286849048eccadecf02b242dbc4042b780944


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2020-12-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22661
pull_request: https://github.com/python/cpython/pull/23801

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2020-12-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fcc6935384b933fbe1a1ef659ed455a3b74c849a by Victor Stinner in 
branch 'master':
Add symbols of the stable ABI to python3dll.c (GH-23598)
https://github.com/python/cpython/commit/fcc6935384b933fbe1a1ef659ed455a3b74c849a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2020-12-04 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-35949 lists Py_ALLOW_RECURSION and Py_END_ALLOW_RECURSION which access 
> PyThreadState.recursion_critical member directly.

Oh, problem solved by:

commit dcc54215ac1eb4b6fab2a9ffe1abcdf3ac4bb77e
Author: Serhiy Storchaka 
Date:   Mon Oct 5 12:32:00 2020 +0300

bpo-41936. Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION 
(GH-22552)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2020-12-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22467
pull_request: https://github.com/python/cpython/pull/23598

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2020-06-25 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-35949 "Move PyThreadState into Include/internal/pycore_pystate.h" 
as a duplicate of this issue.

bpo-35949 lists Py_ALLOW_RECURSION and Py_END_ALLOW_RECURSION which access 
PyThreadState.recursion_critical member directly.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2020-06-01 Thread STINNER Victor


STINNER Victor  added the comment:

Cython still access multiple PyThreadState members which have no getter or 
setter yet.

__Pyx_PyErr_ExceptionMatchesInState():

PyObject *exc_type = tstate->curexc_type;
...

=> internal _PyErr_Occurred(tstate) could solve this issue: move it the 
public/private API? Or expose internal _PyErr_ExceptionMatches(tstate, exc)?

__Pyx_ErrRestoreInState() is a reimplementation of internal _PyErr_Restore(): 
get/set curexc_type, curexc_value and curexc_traceback members.

__Pyx_PyFunction_FastCallNoKw:

static PyObject* __Pyx_PyFunction_FastCallNoKw(...) {
...
++tstate->recursion_depth;
Py_DECREF(f);
--tstate->recursion_depth;
return result;
}

Why not calling Py_EnterRecursiveCall/Py_LeaveRecursiveCall?

There are likely others.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2020-04-14 Thread STINNER Victor


Change by STINNER Victor :


--
title: Make the PyThreadState structure opaque (move it to the internal C API) 
-> [C API] Make the PyThreadState structure opaque (move it to the internal C 
API)

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com