Skip to content

Commit 5a9ff1d

Browse files
Merge remote-tracking branch 'upstream/main' into c-attribute-mutation-tests
2 parents 116badf + 8e96dd6 commit 5a9ff1d

33 files changed

Lines changed: 1030 additions & 359 deletions

Doc/about.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ and now maintained as an independent project.
1010
.. _reStructuredText: https://docutils.sourceforge.io/rst.html
1111
.. _Sphinx: https://www.sphinx-doc.org/
1212

13-
.. In the online version of these documents, you can submit comments and suggest
13+
.. In the online version of this documentation, you can submit comments and suggest
1414
changes directly on the documentation pages.
1515
1616
Development of the documentation and its toolchain is an entirely volunteer

Doc/c-api/import.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Importing Modules
146146
alternatives.
147147
148148
.. versionchanged:: 3.15
149-
``__cached__`` is no longer set.
149+
The ``__cached__`` attribute is no longer set.
150150
151151
152152
.. c:function:: PyObject* PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname)
@@ -170,7 +170,7 @@ Importing Modules
170170
:class:`~importlib.machinery.ModuleSpec` for alternatives.
171171
172172
.. versionchanged:: 3.15
173-
``__cached__`` no longer set.
173+
The ``__cached__`` attribute no longer set.
174174
175175
176176
.. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co, const char *pathname, const char *cpathname)

Doc/library/curses.rst

Lines changed: 239 additions & 173 deletions
Large diffs are not rendered by default.

Doc/library/runpy.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ The :mod:`!runpy` module provides two functions:
9797
:class:`~importlib.machinery.ModuleSpec` for alternatives.
9898

9999
.. versionchanged:: 3.15
100-
``__cached__`` is no longer set.
100+
The global variable ``__cached__`` is no longer set.
101101

102102
.. function:: run_path(path_name, init_globals=None, run_name=None)
103103

@@ -175,7 +175,7 @@ The :mod:`!runpy` module provides two functions:
175175
``__package__`` are deprecated.
176176

177177
.. versionchanged:: 3.15
178-
``__cached__`` is no longer set.
178+
The global variable ``__cached__`` is no longer set.
179179

180180
.. seealso::
181181

Doc/reference/datamodel.rst

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,14 +1099,9 @@ this approach.
10991099
:ref:`import system <importsystem>` may opt to leave it unset if it
11001100
has no semantic meaning (for example, a module loaded from a database).
11011101

1102-
.. deprecated-removed:: 3.13 3.15
1103-
Setting ``__cached__`` on a module while failing to set
1104-
:attr:`!__spec__.cached` is deprecated. In Python 3.15,
1105-
``__cached__`` will cease to be set or taken into consideration by
1106-
the import system or standard library.
1107-
1108-
.. versionchanged:: 3.15
1109-
``__cached__`` is no longer set.
1102+
.. versionchanged:: 3.15
1103+
The ``__cached__`` attribute is no longer set on modules or taken into
1104+
consideration by the import system or standard library.
11101105

11111106
Other writable attributes on module objects
11121107
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Doc/tools/templates/indexsidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h3>{% trans %}Download{% endtrans %}</h3>
2-
<p><a href="{{ pathto('download') }}">{% trans %}Download these documents{% endtrans %}</a></p>
2+
<p><a href="{{ pathto('download') }}">{% trans %}Download the documentation{% endtrans %}</a></p>
33
<h3>{% trans %}Docs by version{% endtrans %}</h3>
44
<ul>
55
{# _docs_by_version.html is overwritten by build_docs.py for non-EOL versions #}

Doc/whatsnew/3.15.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,14 @@ Other language changes
880880
other, as regular dynamic extensions do.
881881
(Contributed by Stefano Rivera in :gh:`122931`.)
882882

883+
* The ``__cached__`` attribute on modules, which was deprecated since version
884+
3.13, is no longer set or taken into consideration by the import system or
885+
standard library.
886+
Use :attr:`__spec__.cached <importlib.machinery.ModuleSpec.cached>` instead.
887+
(Contributed by Brett Cannon in :gh:`97879`)
888+
889+
Note that the :attr:`~module.__loader__` and :attr:`~module.__package__`
890+
attributes are also deprecated and scheduled for removal.
883891

884892

885893
Default interactive shell

Doc/whatsnew/3.16.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ curses
216216
counterpart of :func:`curses.termattrs`.
217217
(Contributed by Serhiy Storchaka in :gh:`152332`.)
218218

219+
* Add the ``WACS_*`` constants to the :mod:`curses` module, the counterparts of
220+
the :ref:`ACS_* <curses-acs-codes>` line-drawing codes as
221+
:class:`curses.complexchar` cells.
222+
(Contributed by Serhiy Storchaka in :gh:`155863`.)
223+
219224
* Add the :mod:`curses` functions :func:`curses.alloc_pair`,
220225
:func:`curses.find_pair`, :func:`curses.free_pair` and
221226
:func:`curses.reset_color_pairs` for dynamic color-pair management,

Lib/curses/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
import os as _os
1515
import sys as _sys
1616

17-
# Some constants, most notably the ACS_* ones, are only added to the C
18-
# _curses module's dictionary after initscr() is called. (Some
17+
# Some constants, most notably the ACS_* and WACS_* ones, are only added
18+
# to the C _curses module's dictionary after initscr() is called. (Some
1919
# versions of SGI's curses don't define values for those constants
2020
# until initscr() has been called.) This wrapper function calls the
2121
# underlying C initscr(), and then copies the constants from the
@@ -30,13 +30,13 @@ def initscr():
3030
fd=_sys.__stdout__.fileno())
3131
stdscr = _curses.initscr()
3232
for key, value in _curses.__dict__.items():
33-
if key.startswith('ACS_') or key in ('LINES', 'COLS'):
33+
if key.startswith(('ACS_', 'WACS_')) or key in ('LINES', 'COLS'):
3434
setattr(curses, key, value)
3535
return stdscr
3636

37-
# newterm() is wrapped for the same reason as initscr(): the ACS_* constants
38-
# and LINES/COLS only become available once a terminal is initialized, and are
39-
# then copied to the curses package's dictionary.
37+
# newterm() is wrapped for the same reason as initscr(): the ACS_* and WACS_*
38+
# constants and LINES/COLS only become available once a terminal is
39+
# initialized, and are then copied to the curses package's dictionary.
4040

4141
try:
4242
newterm
@@ -47,7 +47,7 @@ def newterm(type=None, fd=None, infd=None, /):
4747
import _curses, curses
4848
screen = _curses.newterm(type, fd, infd)
4949
for key, value in _curses.__dict__.items():
50-
if key.startswith('ACS_') or key in ('LINES', 'COLS'):
50+
if key.startswith(('ACS_', 'WACS_')) or key in ('LINES', 'COLS'):
5151
setattr(curses, key, value)
5252
return screen
5353

Lib/test/test_ctypes/test_delattr.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from ctypes import CDLL, Structure, c_char, c_int
2+
from ctypes import CDLL, POINTER, Structure, c_char, c_int
33
from test.support import import_helper
44

55

@@ -17,6 +17,11 @@ def test_chararray(self):
1717
with self.assertRaises(TypeError):
1818
del chararray.value
1919

20+
def test_pointer_contents(self):
21+
ptr = POINTER(c_int)(c_int(42))
22+
with self.assertRaises(TypeError):
23+
del ptr.contents
24+
2025
def test_struct(self):
2126
struct = X()
2227
with self.assertRaises(TypeError):

0 commit comments

Comments
 (0)