Skip to content

Commit 2ed828a

Browse files
authored
Merge branch 'main' into fix-mimetypes-case-sensitive-add-type
2 parents 430a329 + 29a920e commit 2ed828a

19 files changed

Lines changed: 106 additions & 49 deletions

.github/SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Security Policy
22

33
Python [provides a security policy and threat model](https://devguide.python.org/security/policy/)
4-
in the Python Development Guide documenting what bugs are vulnerabilities,
4+
in the Python Developer's Guide documenting what bugs are vulnerabilities,
55
how to structure reports, and what versions of Python accept reports.
66

77
Python Security Response Team (PSRT) members

Doc/c-api/typeobj.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,13 +2975,13 @@ Buffer Object Structures
29752975
steps:
29762976

29772977
(1) Check if the request can be met. If not, raise :exc:`BufferError`,
2978-
set :c:expr:`view->obj` to ``NULL`` and return ``-1``.
2978+
set ``view->obj`` to ``NULL`` and return ``-1``.
29792979

29802980
(2) Fill in the requested fields.
29812981

29822982
(3) Increment an internal counter for the number of exports.
29832983

2984-
(4) Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`.
2984+
(4) Set ``view->obj`` to *exporter* and increment ``view->obj``.
29852985

29862986
(5) Return ``0``.
29872987

@@ -3007,10 +3007,10 @@ Buffer Object Structures
30073007
schemes can be used:
30083008

30093009
* Re-export: Each member of the tree acts as the exporting object and
3010-
sets :c:expr:`view->obj` to a new reference to itself.
3010+
sets ``view->obj`` to a new reference to itself.
30113011

30123012
* Redirect: The buffer request is redirected to the root object of the
3013-
tree. Here, :c:expr:`view->obj` will be a new reference to the root
3013+
tree. Here, ``view->obj`` will be a new reference to the root
30143014
object.
30153015

30163016
The individual fields of *view* are described in section
@@ -3064,7 +3064,7 @@ Buffer Object Structures
30643064
*view* argument.
30653065

30663066

3067-
This function MUST NOT decrement :c:expr:`view->obj`, since that is
3067+
This function MUST NOT decrement ``view->obj``, since that is
30683068
done automatically in :c:func:`PyBuffer_Release` (this scheme is
30693069
useful for breaking reference cycles).
30703070

Doc/library/collections.abc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin:
456456
The :class:`Set` mixin provides a :meth:`!_hash` method to compute a hash value
457457
for the set; however, :meth:`~object.__hash__` is not defined because not all sets
458458
are :term:`hashable` or immutable. To add set hashability using mixins,
459-
inherit from both :meth:`Set` and :meth:`Hashable`, then define
459+
inherit from both :class:`Set` and :class:`Hashable`, then define
460460
``__hash__ = Set._hash``.
461461

462462
.. seealso::

Doc/library/operator.rst

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The mathematical and bitwise operations are the most numerous:
110110
.. function:: and_(a, b)
111111
__and__(a, b)
112112

113-
Return the bitwise and of *a* and *b*.
113+
Return ``a & b``.
114114

115115

116116
.. function:: floordiv(a, b)
@@ -134,13 +134,13 @@ The mathematical and bitwise operations are the most numerous:
134134
__inv__(obj)
135135
__invert__(obj)
136136

137-
Return the bitwise inverse of the number *obj*. This is equivalent to ``~obj``.
137+
Return ``~obj``.
138138

139139

140140
.. function:: lshift(a, b)
141141
__lshift__(a, b)
142142

143-
Return *a* shifted left by *b*.
143+
Return ``a << b``.
144144

145145

146146
.. function:: mod(a, b)
@@ -152,7 +152,7 @@ The mathematical and bitwise operations are the most numerous:
152152
.. function:: mul(a, b)
153153
__mul__(a, b)
154154

155-
Return ``a * b``, for *a* and *b* numbers.
155+
Return ``a * b``.
156156

157157

158158
.. function:: matmul(a, b)
@@ -172,25 +172,25 @@ The mathematical and bitwise operations are the most numerous:
172172
.. function:: or_(a, b)
173173
__or__(a, b)
174174

175-
Return the bitwise or of *a* and *b*.
175+
Return ``a | b``.
176176

177177

178178
.. function:: pos(obj)
179179
__pos__(obj)
180180

181-
Return *obj* positive (``+obj``).
181+
Return ``+obj``.
182182

183183

184184
.. function:: pow(a, b)
185185
__pow__(a, b)
186186

187-
Return ``a ** b``, for *a* and *b* numbers.
187+
Return ``a ** b``.
188188

189189

190190
.. function:: rshift(a, b)
191191
__rshift__(a, b)
192192

193-
Return *a* shifted right by *b*.
193+
Return ``a >> b``.
194194

195195

196196
.. function:: sub(a, b)
@@ -209,7 +209,7 @@ The mathematical and bitwise operations are the most numerous:
209209
.. function:: xor(a, b)
210210
__xor__(a, b)
211211

212-
Return the bitwise exclusive or of *a* and *b*.
212+
Return ``a ^ b``.
213213

214214

215215
Operations which work with sequences (some of them with mappings too) include:
@@ -403,13 +403,18 @@ Python syntax and the functions in the :mod:`!operator` module.
403403
+-----------------------+-------------------------+---------------------------------------+
404404
| Division | ``a // b`` | ``floordiv(a, b)`` |
405405
+-----------------------+-------------------------+---------------------------------------+
406-
| Bitwise And | ``a & b`` | ``and_(a, b)`` |
406+
| Bitwise And, or | ``a & b`` | ``and_(a, b)`` |
407+
| Intersection | | |
407408
+-----------------------+-------------------------+---------------------------------------+
408-
| Bitwise Exclusive Or | ``a ^ b`` | ``xor(a, b)`` |
409+
| Bitwise Exclusive Or, | ``a ^ b`` | ``xor(a, b)`` |
410+
| or Symmetric | | |
411+
| Difference | | |
409412
+-----------------------+-------------------------+---------------------------------------+
410-
| Bitwise Inversion | ``~ a`` | ``invert(a)`` |
413+
| Bitwise Inversion, or | ``~ a`` | ``invert(a)`` |
414+
| Complement | | |
411415
+-----------------------+-------------------------+---------------------------------------+
412-
| Bitwise Or | ``a | b`` | ``or_(a, b)`` |
416+
| Bitwise Or, or | ``a | b`` | ``or_(a, b)`` |
417+
| Union | | |
413418
+-----------------------+-------------------------+---------------------------------------+
414419
| Exponentiation | ``a ** b`` | ``pow(a, b)`` |
415420
+-----------------------+-------------------------+---------------------------------------+

Doc/library/profiling.sampling.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,6 @@ This requires one of:
387387
On Windows, the profiler requires administrative privileges or the
388388
``SeDebugPrivilege`` privilege to read another process's memory.
389389

390-
*Note*: On Windows, ``python -m profiling.sampling`` fails inside a virtual
391-
environment because the venv's ``python.exe`` is just a launcher shim that
392-
re-executes the base interpreter as a child process. The shim itself isn't
393-
a Python process and has no ``PyRuntime`` section to attach to. Instead,
394-
run it from the global Python installation.
395390

396391
Version compatibility
397392
---------------------

Doc/library/stdtypes.rst

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,9 +2174,25 @@ expression support in the :mod:`re` module).
21742174
character, ``False`` otherwise. Digits include decimal characters and digits that need
21752175
special handling, such as the compatibility superscript digits.
21762176
This covers digits which cannot be used to form numbers in base 10,
2177-
like the Kharosthi numbers. Formally, a digit is a character that has the
2177+
like the `Kharosthi numbers <https://en.wikipedia.org/wiki/Kharosthi#Numerals>`__.
2178+
Formally, a digit is a character that has the
21782179
property value Numeric_Type=Digit or Numeric_Type=Decimal.
21792180

2181+
For example:
2182+
2183+
.. doctest::
2184+
2185+
>>> '0123456789'.isdigit()
2186+
True
2187+
>>> '٠١٢٣٤٥٦٧٨٩'.isdigit() # Arabic-Indic digits zero to nine
2188+
True
2189+
>>> ''.isdigit() # Vulgar fraction one fifth
2190+
False
2191+
>>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()
2192+
(False, True, True)
2193+
2194+
See also :meth:`isdecimal` and :meth:`isnumeric`.
2195+
21802196

21812197
.. method:: str.isidentifier()
21822198

@@ -2217,15 +2233,14 @@ expression support in the :mod:`re` module).
22172233

22182234
>>> '0123456789'.isnumeric()
22192235
True
2220-
>>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-indic digit zero to nine
2236+
>>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-Indic digits zero to nine
22212237
True
22222238
>>> ''.isnumeric() # Vulgar fraction one fifth
22232239
True
22242240
>>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()
22252241
(False, True, True)
22262242

2227-
See also :meth:`isdecimal` and :meth:`isdigit`. Numeric characters are
2228-
a superset of decimal numbers.
2243+
See also :meth:`isdecimal` and :meth:`isdigit`.
22292244

22302245

22312246
.. method:: str.isprintable()

Doc/reference/datamodel.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,12 +2230,12 @@ Basic customization
22302230
pair: built-in function; hash
22312231

22322232
Called by built-in function :func:`hash` and for operations on members of
2233-
hashed collections including :class:`set`, :class:`frozenset`, and
2234-
:class:`dict`. The ``__hash__()`` method should return an integer. The only required
2235-
property is that objects which compare equal have the same hash value; it is
2236-
advised to mix together the hash values of the components of the object that
2237-
also play a part in comparison of objects by packing them into a tuple and
2238-
hashing the tuple. Example::
2233+
hashed collections including :class:`set`, :class:`frozenset`, :class:`dict`,
2234+
and :class:`frozendict`. The ``__hash__()`` method should return an integer.
2235+
The only required property is that objects which compare equal have the same
2236+
hash value; it is advised to mix together the hash values of the components
2237+
of the object that also play a part in comparison of objects by packing them
2238+
into a tuple and hashing the tuple. Example::
22392239

22402240
def __hash__(self):
22412241
return hash((self.name, self.nick, self.color))

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
Doc/c-api/init_config.rst
66
Doc/c-api/intro.rst
77
Doc/c-api/stable.rst
8-
Doc/c-api/typeobj.rst
98
Doc/library/ast.rst
109
Doc/library/asyncio-extending.rst
1110
Doc/library/email.charset.rst

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ struct _Py_global_strings {
876876
STRUCT_FOR_ID(updates)
877877
STRUCT_FOR_ID(uri)
878878
STRUCT_FOR_ID(usedforsecurity)
879+
STRUCT_FOR_ID(utcoffset)
879880
STRUCT_FOR_ID(value)
880881
STRUCT_FOR_ID(values)
881882
STRUCT_FOR_ID(version)

0 commit comments

Comments
 (0)