Skip to content

Commit b43c3c9

Browse files
authored
Merge branch 'main' into warsaw/asottle-gh-75723
2 parents 95895dd + a8e3247 commit b43c3c9

32 files changed

Lines changed: 215 additions & 191 deletions

Doc/c-api/unicode.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ APIs:
762762
The string must not have been “used” yet.
763763
See :c:func:`PyUnicode_New` for details.
764764
765-
Return the number of written character, or return ``-1`` and raise an
765+
Return the number of written characters, or return ``-1`` and raise an
766766
exception on error.
767767
768768
.. versionadded:: 3.3
@@ -1174,7 +1174,7 @@ These are the UTF-8 codec APIs:
11741174
.. versionadded:: 3.3
11751175
11761176
.. versionchanged:: 3.7
1177-
The return type is now ``const char *`` rather of ``char *``.
1177+
The return type is now ``const char *`` rather than ``char *``.
11781178
11791179
.. versionchanged:: 3.10
11801180
This function is a part of the :ref:`limited API <limited-c-api>`.
@@ -1196,7 +1196,7 @@ These are the UTF-8 codec APIs:
11961196
.. versionadded:: 3.3
11971197
11981198
.. versionchanged:: 3.7
1199-
The return type is now ``const char *`` rather of ``char *``.
1199+
The return type is now ``const char *`` rather than ``char *``.
12001200
12011201
12021202
UTF-32 Codecs

Doc/deprecations/pending-removal-in-3.16.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Pending removal in Python 3.16
8484

8585
* :mod:`symtable`:
8686

87-
* The :meth:`Class.get_methods <symtable.Class.get_methods>` method
87+
* The :meth:`!symtable.Class.get_methods` method
8888
has been deprecated since Python 3.14.
8989

9090
* :mod:`sys`:

Doc/library/pathlib.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,8 @@ Reading and writing files
12661266
>>> p.read_text()
12671267
'Text file contents'
12681268

1269+
Return the number of characters written.
1270+
12691271
An existing file of the same name is overwritten. The optional parameters
12701272
have the same meaning as in :func:`open`.
12711273

@@ -1286,6 +1288,8 @@ Reading and writing files
12861288
>>> p.read_bytes()
12871289
b'Binary file contents'
12881290

1291+
Return the number of bytes written.
1292+
12891293
An existing file of the same name is overwritten.
12901294

12911295
.. versionadded:: 3.5

Doc/library/symtable.rst

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -187,57 +187,6 @@ Examining Symbol Tables
187187

188188
A namespace of a class. This class inherits from :class:`SymbolTable`.
189189

190-
.. method:: get_methods()
191-
192-
Return a tuple containing the names of method-like functions declared
193-
in the class.
194-
195-
Here, the term 'method' designates *any* function defined in the class
196-
body via :keyword:`def` or :keyword:`async def`.
197-
198-
Functions defined in a deeper scope (e.g., in an inner class) are not
199-
picked up by :meth:`get_methods`.
200-
201-
For example:
202-
203-
.. testsetup:: symtable.Class.get_methods
204-
205-
import warnings
206-
context = warnings.catch_warnings()
207-
context.__enter__()
208-
warnings.simplefilter("ignore", category=DeprecationWarning)
209-
210-
.. testcleanup:: symtable.Class.get_methods
211-
212-
context.__exit__()
213-
214-
.. doctest:: symtable.Class.get_methods
215-
216-
>>> import symtable
217-
>>> st = symtable.symtable('''
218-
... def outer(): pass
219-
...
220-
... class A:
221-
... def f():
222-
... def w(): pass
223-
...
224-
... def g(self): pass
225-
...
226-
... @classmethod
227-
... async def h(cls): pass
228-
...
229-
... global outer
230-
... def outer(self): pass
231-
... ''', 'test', 'exec')
232-
>>> class_A = st.get_children()[2]
233-
>>> class_A.get_methods()
234-
('f', 'g', 'h')
235-
236-
Although ``A().f()`` raises :exc:`TypeError` at runtime, ``A.f`` is still
237-
considered as a method-like function.
238-
239-
.. deprecated-removed:: 3.14 3.16
240-
241190

242191
.. class:: Symbol
243192

Doc/tools/removed-ids.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ c-api/allocation.html: deprecated-aliases
55
c-api/file.html: deprecated-api
66

77
library/asyncio-task.html: terminating-a-task-group
8+
9+
# Removed APIs
10+
library/symtable.html: symtable.Class.get_methods

Doc/whatsnew/3.14.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,7 @@ New deprecations
27182718
(Contributed by Tian Gao in :gh:`124369` and :gh:`125951`.)
27192719

27202720
* :mod:`symtable`:
2721-
Deprecate :meth:`symtable.Class.get_methods` due to the lack of interest,
2721+
Deprecate :meth:`!symtable.Class.get_methods` due to the lack of interest,
27222722
scheduled for removal in Python 3.16.
27232723
(Contributed by Bénédikt Tran in :gh:`119698`.)
27242724

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ Other language changes
798798
n = buffer.find(b'\n')
799799
data = bytes(buffer[:n + 1])
800800
del buffer[:n + 1]
801-
assert data == b'abc'
801+
assert data == b'abc\n'
802802
assert buffer == bytearray(b'def')
803803

804804
- .. code:: python

Doc/whatsnew/3.16.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ functools
120120
* Calling the Python implementation of :func:`functools.reduce` with *function*
121121
or *sequence* as keyword arguments has been deprecated since Python 3.14.
122122

123+
symtable
124+
--------
125+
126+
* The :meth:`!symtable.Class.get_methods` method
127+
which has been deprecated since Python 3.14.
128+
123129
sysconfig
124130
---------
125131

Include/internal/pycore_pyhash.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ _Py_HashPointerRaw(const void *ptr)
2727
* pppppppp ssssssss ........ fnv -- two Py_hash_t
2828
* k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t
2929
* ........ ........ ssssssss djbx33a -- 16 bytes padding + one Py_hash_t
30-
* ........ ........ eeeeeeee pyexpat XML hash salt
30+
* eeeeeeee eeeeeeee eeeeeeee pyexpat XML hash salt
3131
*
3232
* memory layout on 32 bit systems
3333
* cccccccc cccccccc cccccccc uc
3434
* ppppssss ........ ........ fnv -- two Py_hash_t
3535
* k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t (*)
3636
* ........ ........ ssss.... djbx33a -- 16 bytes padding + one Py_hash_t
37-
* ........ ........ eeee.... pyexpat XML hash salt
37+
* eeeeeeee eeeeeeee eeee.... pyexpat XML hash salt
3838
*
3939
* (*) The siphash member may not be available on 32 bit platforms without
4040
* an unsigned int64 data type.
@@ -58,7 +58,9 @@ typedef union {
5858
Py_hash_t suffix;
5959
} djbx33a;
6060
struct {
61-
unsigned char padding[16];
61+
/* 16 bytes for XML_SetHashSalt16Bytes */
62+
uint8_t hashsalt16[16];
63+
/* 4/8 bytes for legacy XML_SetHashSalt */
6264
Py_hash_t hashsalt;
6365
} expat;
6466
} _Py_HashSecret_t;

Include/pyexpat.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ struct PyExpat_CAPI
6262
XML_Parser parser, unsigned long long activationThresholdBytes);
6363
XML_Bool (*SetBillionLaughsAttackProtectionMaximumAmplification)(
6464
XML_Parser parser, float maxAmplificationFactor);
65+
/* might be NULL for expat < 2.8.0 */
66+
XML_Bool (*SetHashSalt16Bytes)(
67+
XML_Parser parser, const uint8_t entropy[16]);
6568
/* always add new stuff to the end! */
6669
};
6770

0 commit comments

Comments
 (0)