<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Python/_warnings.c, branch master</title>
<subtitle>Python interpreter</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/_warnings.c?h=master</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/_warnings.c?h=master'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2023-06-11T19:46:02Z</updated>
<entry>
<title>[3.11] gh-105375: Improve PyErr_WarnExplicit() error handling (GH-105610) (#105660)</title>
<updated>2023-06-11T19:46:02Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2023-06-11T19:46:02Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=05c73e1cd872843952f0e769265ec3d9535488f6'/>
<id>urn:sha1:05c73e1cd872843952f0e769265ec3d9535488f6</id>
<content type='text'>
Bail on first error to prevent exceptions from possibly being
overwritten.
(cherry picked from commit 567d6ae8e77579173510fc948ac06b2ababf3d40)

Co-authored-by: Erlend E. Aasland &lt;erlend.aasland@protonmail.com&gt;</content>
</entry>
<entry>
<title>gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938) (#94000)</title>
<updated>2022-06-20T13:47:41Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2022-06-20T13:47:41Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=96254a9acd0d9dbb49b7d54fd529223b2253245b'/>
<id>urn:sha1:96254a9acd0d9dbb49b7d54fd529223b2253245b</id>
<content type='text'>
Move the follow functions and type from frameobject.h to pyframe.h,
so the standard &lt;Python.h&gt; provide frame getter functions:

* PyFrame_Check()
* PyFrame_GetBack()
* PyFrame_GetBuiltins()
* PyFrame_GetGenerator()
* PyFrame_GetGlobals()
* PyFrame_GetLasti()
* PyFrame_GetLocals()
* PyFrame_Type

Remove #include "frameobject.h" from many C files. It's no longer
needed.

(cherry picked from commit 27b989403356ccdd47545a93aeab8434e9c69f21)</content>
</entry>
<entry>
<title>bpo-47164: Add _PyCFunction_CAST() macro (GH-32192)</title>
<updated>2022-03-31T08:02:34Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2022-03-31T08:02:34Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=f0bc69485677ae8973685866ada0982976d3878f'/>
<id>urn:sha1:f0bc69485677ae8973685866ada0982976d3878f</id>
<content type='text'>
Use the macro in C files of the Python/ directory.</content>
</entry>
<entry>
<title>bpo-46765: Replace Locally Cached Strings with Statically Initialized Objects (gh-31366)</title>
<updated>2022-02-23T00:23:51Z</updated>
<author>
<name>Eric Snow</name>
<email>ericsnowcurrently@gmail.com</email>
</author>
<published>2022-02-23T00:23:51Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=1f455361ecfb1892e375bdbee813cdf095b6cfb8'/>
<id>urn:sha1:1f455361ecfb1892e375bdbee813cdf095b6cfb8</id>
<content type='text'>
https://bugs.python.org/issue46765</content>
</entry>
<entry>
<title>bpo-46541: Discover the global strings. (gh-31346)</title>
<updated>2022-02-15T00:36:51Z</updated>
<author>
<name>Eric Snow</name>
<email>ericsnowcurrently@gmail.com</email>
</author>
<published>2022-02-15T00:36:51Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=12360aa159c42c7798fd14225d271e6fd84db7eb'/>
<id>urn:sha1:12360aa159c42c7798fd14225d271e6fd84db7eb</id>
<content type='text'>
Instead of manually enumerating the global strings in generate_global_objects.py, we extrapolate the list from usage of _Py_ID() and _Py_STR() in the source files.

This is partly inspired by gh-31261.

https://bugs.python.org/issue46541</content>
</entry>
<entry>
<title>bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized global objects. (gh-30928)</title>
<updated>2022-02-08T20:39:07Z</updated>
<author>
<name>Eric Snow</name>
<email>ericsnowcurrently@gmail.com</email>
</author>
<published>2022-02-08T20:39:07Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=81c72044a181dbbfbf689d7a977d0d99090f26a8'/>
<id>urn:sha1:81c72044a181dbbfbf689d7a977d0d99090f26a8</id>
<content type='text'>
We're no longer using _Py_IDENTIFIER() (or _Py_static_string()) in any core CPython code.  It is still used in a number of non-builtin stdlib modules.

The replacement is: PyUnicodeObject (not pointer) fields under _PyRuntimeState, statically initialized as part of _PyRuntime.  A new _Py_GET_GLOBAL_IDENTIFIER() macro facilitates lookup of the fields (along with _Py_GET_GLOBAL_STRING() for non-identifier strings).

https://bugs.python.org/issue46541#msg411799 explains the rationale for this change.

The core of the change is in:

* (new) Include/internal/pycore_global_strings.h - the declarations for the global strings, along with the macros
* Include/internal/pycore_runtime_init.h - added the static initializers for the global strings
* Include/internal/pycore_global_objects.h - where the struct in pycore_global_strings.h is hooked into _PyRuntimeState
* Tools/scripts/generate_global_objects.py - added generation of the global string declarations and static initializers

I've also added a --check flag to generate_global_objects.py (along with make check-global-objects) to check for unused global strings.  That check is added to the PR CI config.

The remainder of this change updates the core code to use _Py_GET_GLOBAL_IDENTIFIER() instead of _Py_IDENTIFIER() and the related _Py*Id functions (likewise for _Py_GET_GLOBAL_STRING() instead of _Py_static_string()).  This includes adding a few functions where there wasn't already an alternative to _Py*Id(), replacing the _Py_Identifier * parameter with PyObject *.

The following are not changed (yet):

* stop using _Py_IDENTIFIER() in the stdlib modules
* (maybe) get rid of _Py_IDENTIFIER(), etc. entirely -- this may not be doable as at least one package on PyPI using this (private) API
* (maybe) intern the strings during runtime init

https://bugs.python.org/issue46541</content>
</entry>
<entry>
<title>bpo-44590: Lazily allocate frame objects (GH-27077)</title>
<updated>2021-07-26T10:22:16Z</updated>
<author>
<name>Mark Shannon</name>
<email>mark@hotpy.org</email>
</author>
<published>2021-07-26T10:22:16Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=ae0a2b756255629140efcbe57fc2e714f0267aa3'/>
<id>urn:sha1:ae0a2b756255629140efcbe57fc2e714f0267aa3</id>
<content type='text'>
* Convert "specials" array to InterpreterFrame struct, adding f_lasti, f_state and other non-debug FrameObject fields to it.

* Refactor, calls pushing the call to the interpreter upward toward _PyEval_Vector.

* Compute f_back when on thread stack, only filling in value when frame object outlives stack invocation.

* Move ownership of InterpreterFrame in generator from frame object to generator object.

* Do not create frame objects for Python calls.

* Do not create frame objects for generators.
</content>
</entry>
<entry>
<title>bpo-43950: Print columns in tracebacks (PEP 657) (GH-26958)</title>
<updated>2021-07-04T23:14:33Z</updated>
<author>
<name>Ammar Askar</name>
<email>ammar@ammaraskar.com</email>
</author>
<published>2021-07-04T23:14:33Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=5644c7b3ffd49bed58dc095be6e6148e0bb4431e'/>
<id>urn:sha1:5644c7b3ffd49bed58dc095be6e6148e0bb4431e</id>
<content type='text'>
The traceback.c and traceback.py mechanisms now utilize the newly added code.co_positions and PyCode_Addr2Location
to print carets on the specific expressions involved in a traceback.

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;
Co-authored-by: Ammar Askar &lt;ammar@ammaraskar.com&gt;
Co-authored-by: Batuhan Taskaya &lt;batuhanosmantaskaya@gmail.com&gt;</content>
</entry>
<entry>
<title>bpo-44032: Move data stack to thread from FrameObject. (GH-26076)</title>
<updated>2021-05-21T09:57:35Z</updated>
<author>
<name>Mark Shannon</name>
<email>mark@hotpy.org</email>
</author>
<published>2021-05-21T09:57:35Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b11a951f16f0603d98de24fee5c023df83ea552c'/>
<id>urn:sha1:b11a951f16f0603d98de24fee5c023df83ea552c</id>
<content type='text'>
* Remove 'zombie' frames. We won't need them once we are allocating fixed-size frames.

* Add co_nlocalplus field to code object to avoid recomputing size of locals + frees + cells.

* Move locals, cells and freevars out of frame object into separate memory buffer.

* Use per-threadstate allocated memory chunks for local variables.

* Move globals and builtins from frame object to per-thread stack.

* Move (slow) locals frame object to per-thread stack.

* Move internal frame functions to internal header.
</content>
</entry>
<entry>
<title>bpo-43268: Pass interp rather than tstate to internal functions (GH-24580)</title>
<updated>2021-02-19T14:10:45Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2021-02-19T14:10:45Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=bcb094b41f7fe4dd1686c50891d85632fcf0d481'/>
<id>urn:sha1:bcb094b41f7fe4dd1686c50891d85632fcf0d481</id>
<content type='text'>
Pass the current interpreter (interp) rather than the current Python
thread state (tstate) to internal functions which only use the
interpreter.

Modified functions:

* _PyXXX_Fini() and _PyXXX_ClearFreeList() functions
* _PyEval_SignalAsyncExc(), make_pending_calls()
* _PySys_GetObject(), sys_set_object(), sys_set_object_id(), sys_set_object_str()
* should_audit(), set_flags_from_config(), make_flags()
* _PyAtExit_Call()
* init_stdio_encoding()
* etc.</content>
</entry>
</feed>
