Skip to content

Commit 7425148

Browse files
authored
Merge branch 'main' into add-missing-cross-references-in-getpass
2 parents c5d4779 + 11a8bdf commit 7425148

12 files changed

Lines changed: 69 additions & 43 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/bisect.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ example uses :py:func:`~bisect.bisect` to look up a letter grade for an exam sco
200200
based on a set of ordered numeric breakpoints: 90 and up is an 'A', 80 to 89 is
201201
a 'B', and so on::
202202

203-
>>> def grade(score)
203+
>>> def grade(score):
204204
... i = bisect([60, 70, 80, 90], score)
205205
... return "FDCBA"[i]
206206
...

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/stdtypes.rst

Lines changed: 26 additions & 11 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()
@@ -2376,7 +2391,8 @@ expression support in the :mod:`re` module).
23762391

23772392
Return a copy of the string with leading characters removed. The *chars*
23782393
argument is a string specifying the set of characters to be removed. If omitted
2379-
or ``None``, the *chars* argument defaults to removing whitespace. The *chars*
2394+
or ``None``, the *chars* argument defaults to removing whitespace, that is
2395+
characters for which :meth:`str.isspace` is true. The *chars*
23802396
argument is not a prefix; rather, all combinations of its values are stripped::
23812397

23822398
>>> ' spacious '.lstrip()
@@ -2579,7 +2595,8 @@ expression support in the :mod:`re` module).
25792595

25802596
Return a copy of the string with trailing characters removed. The *chars*
25812597
argument is a string specifying the set of characters to be removed. If omitted
2582-
or ``None``, the *chars* argument defaults to removing whitespace. The *chars*
2598+
or ``None``, the *chars* argument defaults to removing whitespace, that is
2599+
characters for which :meth:`str.isspace` is true. The *chars*
25832600
argument is not a suffix; rather, all combinations of its values are stripped.
25842601
For example:
25852602

@@ -2755,11 +2772,9 @@ expression support in the :mod:`re` module).
27552772

27562773
Return a copy of the string with the leading and trailing characters removed.
27572774
The *chars* argument is a string specifying the set of characters to be removed.
2758-
If omitted or ``None``, the *chars* argument defaults to removing whitespace.
2759-
The *chars* argument is not a prefix or suffix; rather, all combinations of its
2760-
values are stripped.
2761-
2762-
Whitespace characters are defined by :meth:`str.isspace`.
2775+
If omitted or ``None``, the *chars* argument defaults to removing whitespace,
2776+
that is characters for which :meth:`str.isspace` is true. The *chars* argument
2777+
is not a prefix or suffix; rather, all combinations of its values are stripped.
27632778

27642779
For example:
27652780

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)

Include/internal/pycore_runtime_init_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.

0 commit comments

Comments
 (0)