Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1e51471

Browse filesBrowse files
Merge branch 'main' into library_argparse_style
2 parents c9f8d30 + 89413bb commit 1e51471
Copy full SHA for 1e51471

File tree

Expand file treeCollapse file tree

192 files changed

+8089
-4872
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

192 files changed

+8089
-4872
lines changed

‎.azure-pipelines/ci.yml

Copy file name to clipboardExpand all lines: .azure-pipelines/ci.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
variables:
5858
testRunTitle: '$(build.sourceBranchName)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1q
60+
openssl_version: 1.1.1t
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1q
86+
openssl_version: 1.1.1t
8787

8888
steps:
8989
- template: ./posix-steps.yml

‎.azure-pipelines/pr.yml

Copy file name to clipboardExpand all lines: .azure-pipelines/pr.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
variables:
5858
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1q
60+
openssl_version: 1.1.1t
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1q
86+
openssl_version: 1.1.1t
8787

8888
steps:
8989
- template: ./posix-steps.yml

‎.github/CODEOWNERS

Copy file name to clipboardExpand all lines: .github/CODEOWNERS
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ Lib/ast.py @isidentical
151151

152152
**/*sysconfig* @FFY00
153153

154+
**/*cjkcodecs* @corona10
155+
154156
# macOS
155157
/Mac/ @python/macos-team
156158
**/*osx_support* @python/macos-team

‎.github/workflows/build.yml

Copy file name to clipboardExpand all lines: .github/workflows/build.yml
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176
needs: check_source
177177
if: needs.check_source.outputs.run_tests == 'true'
178178
env:
179-
OPENSSL_VER: 1.1.1s
179+
OPENSSL_VER: 1.1.1t
180180
PYTHONSTRICTEXTENSIONBUILD: 1
181181
steps:
182182
- uses: actions/checkout@v3
@@ -235,7 +235,7 @@ jobs:
235235
strategy:
236236
fail-fast: false
237237
matrix:
238-
openssl_ver: [1.1.1s, 3.0.7, 3.1.0-beta1]
238+
openssl_ver: [1.1.1t, 3.0.8, 3.1.0-beta1]
239239
env:
240240
OPENSSL_VER: ${{ matrix.openssl_ver }}
241241
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -282,7 +282,7 @@ jobs:
282282
needs: check_source
283283
if: needs.check_source.outputs.run_tests == 'true'
284284
env:
285-
OPENSSL_VER: 1.1.1s
285+
OPENSSL_VER: 1.1.1t
286286
PYTHONSTRICTEXTENSIONBUILD: 1
287287
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
288288
steps:

‎Doc/c-api/dict.rst

Copy file name to clipboardExpand all lines: Doc/c-api/dict.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Dictionary Objects
8080
8181
.. c:function:: int PyDict_DelItem(PyObject *p, PyObject *key)
8282
83-
Remove the entry in dictionary *p* with key *key*. *key* must be hashable;
83+
Remove the entry in dictionary *p* with key *key*. *key* must be :term:`hashable`;
8484
if it isn't, :exc:`TypeError` is raised.
8585
If *key* is not in the dictionary, :exc:`KeyError` is raised.
8686
Return ``0`` on success or ``-1`` on failure.

‎Doc/c-api/function.rst

Copy file name to clipboardExpand all lines: Doc/c-api/function.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ There are a few functions specific to Python functions.
169169
before the modification to *func* takes place, so the prior state of *func*
170170
can be inspected. The runtime is permitted to optimize away the creation of
171171
function objects when possible. In such cases no event will be emitted.
172-
Although this creates the possitibility of an observable difference of
172+
Although this creates the possibility of an observable difference of
173173
runtime behavior depending on optimization decisions, it does not change
174174
the semantics of the Python code being executed.
175175

‎Doc/c-api/module.rst

Copy file name to clipboardExpand all lines: Doc/c-api/module.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,15 +388,15 @@ objects dynamically. Note that both ``PyModule_FromDefAndSpec`` and
388388
389389
.. c:function:: PyObject * PyModule_FromDefAndSpec(PyModuleDef *def, PyObject *spec)
390390
391-
Create a new module object, given the definition in *module* and the
391+
Create a new module object, given the definition in *def* and the
392392
ModuleSpec *spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2`
393393
with *module_api_version* set to :const:`PYTHON_API_VERSION`.
394394
395395
.. versionadded:: 3.5
396396
397397
.. c:function:: PyObject * PyModule_FromDefAndSpec2(PyModuleDef *def, PyObject *spec, int module_api_version)
398398
399-
Create a new module object, given the definition in *module* and the
399+
Create a new module object, given the definition in *def* and the
400400
ModuleSpec *spec*, assuming the API version *module_api_version*.
401401
If that version does not match the version of the running interpreter,
402402
a :exc:`RuntimeWarning` is emitted.

‎Doc/c-api/object.rst

Copy file name to clipboardExpand all lines: Doc/c-api/object.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Object Protocol
281281
282282
.. c:function:: Py_hash_t PyObject_HashNotImplemented(PyObject *o)
283283
284-
Set a :exc:`TypeError` indicating that ``type(o)`` is not hashable and return ``-1``.
284+
Set a :exc:`TypeError` indicating that ``type(o)`` is not :term:`hashable` and return ``-1``.
285285
This function receives special treatment when stored in a ``tp_hash`` slot,
286286
allowing a type to explicitly indicate to the interpreter that it is not
287287
hashable.

‎Doc/c-api/typeobj.rst

Copy file name to clipboardExpand all lines: Doc/c-api/typeobj.rst
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,16 @@ and :c:type:`PyType_Type` effectively act as defaults.)
13131313
.. versionadded:: 3.10
13141314

13151315

1316+
.. data:: Py_TPFLAGS_VALID_VERSION_TAG
1317+
1318+
Internal. Do not set or unset this flag.
1319+
To indicate that a class has changed call :c:func:`PyType_Modified`
1320+
1321+
.. warning::
1322+
This flag is present in header files, but is an internal feature and should
1323+
not be used. It will be removed in a future version of CPython
1324+
1325+
13161326
.. c:member:: const char* PyTypeObject.tp_doc
13171327
13181328
An optional pointer to a NUL-terminated C string giving the docstring for this

‎Doc/faq/programming.rst

Copy file name to clipboardExpand all lines: Doc/faq/programming.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,7 @@ method result will be released right away. The disadvantage is that if
19791979
instances accumulate, so too will the accumulated method results. They
19801980
can grow without bound.
19811981

1982-
The *lru_cache* approach works with methods that have hashable
1982+
The *lru_cache* approach works with methods that have :term:`hashable`
19831983
arguments. It creates a reference to the instance unless special
19841984
efforts are made to pass in weak references.
19851985

‎Doc/library/abc.rst

Copy file name to clipboardExpand all lines: Doc/library/abc.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The :mod:`collections` module has some concrete classes that derive from
2121
ABCs; these can, of course, be further derived. In addition, the
2222
:mod:`collections.abc` submodule has some ABCs that can be used to test whether
2323
a class or instance provides a particular interface, for example, if it is
24-
hashable or if it is a mapping.
24+
:term:`hashable` or if it is a mapping.
2525

2626

2727
This module provides the metaclass :class:`ABCMeta` for defining ABCs and

‎Doc/library/asyncio-stream.rst

Copy file name to clipboardExpand all lines: Doc/library/asyncio-stream.rst
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,20 @@ StreamReader
206206

207207
.. coroutinemethod:: read(n=-1)
208208

209-
Read up to *n* bytes. If *n* is not provided, or set to ``-1``,
210-
read until EOF and return all read bytes.
209+
Read up to *n* bytes from the stream.
211210

211+
If *n* is not provided or set to ``-1``,
212+
read until EOF, then return all read :class:`bytes`.
212213
If EOF was received and the internal buffer is empty,
213214
return an empty ``bytes`` object.
214215

216+
If *n* is ``0``, return an empty ``bytes`` object immediately.
217+
218+
If *n* is positive, return at most *n* available ``bytes``
219+
as soon as at least 1 byte is available in the internal buffer.
220+
If EOF is received before any byte is read, return an empty
221+
``bytes`` object.
222+
215223
.. coroutinemethod:: readline()
216224

217225
Read one line, where "line" is a sequence of bytes

‎Doc/library/collections.abc.rst

Copy file name to clipboardExpand all lines: Doc/library/collections.abc.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
This module provides :term:`abstract base classes <abstract base class>` that
2424
can be used to test whether a class provides a particular interface; for
25-
example, whether it is hashable or whether it is a mapping.
25+
example, whether it is :term:`hashable` or whether it is a mapping.
2626

2727
An :func:`issubclass` or :func:`isinstance` test for an interface works in one
2828
of three ways.
@@ -406,7 +406,7 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin:
406406
(3)
407407
The :class:`Set` mixin provides a :meth:`_hash` method to compute a hash value
408408
for the set; however, :meth:`__hash__` is not defined because not all sets
409-
are hashable or immutable. To add set hashability using mixins,
409+
are :term:`hashable` or immutable. To add set hashability using mixins,
410410
inherit from both :meth:`Set` and :meth:`Hashable`, then define
411411
``__hash__ = Set._hash``.
412412

‎Doc/library/collections.rst

Copy file name to clipboardExpand all lines: Doc/library/collections.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Python's general purpose built-in containers, :class:`dict`, :class:`list`,
2525
:func:`namedtuple` factory function for creating tuple subclasses with named fields
2626
:class:`deque` list-like container with fast appends and pops on either end
2727
:class:`ChainMap` dict-like class for creating a single view of multiple mappings
28-
:class:`Counter` dict subclass for counting hashable objects
28+
:class:`Counter` dict subclass for counting :term:`hashable` objects
2929
:class:`OrderedDict` dict subclass that remembers the order entries were added
3030
:class:`defaultdict` dict subclass that calls a factory function to supply missing values
3131
:class:`UserDict` wrapper around dictionary objects for easier dict subclassing
@@ -242,7 +242,7 @@ For example::
242242

243243
.. class:: Counter([iterable-or-mapping])
244244

245-
A :class:`Counter` is a :class:`dict` subclass for counting hashable objects.
245+
A :class:`Counter` is a :class:`dict` subclass for counting :term:`hashable` objects.
246246
It is a collection where elements are stored as dictionary keys
247247
and their counts are stored as dictionary values. Counts are allowed to be
248248
any integer value including zero or negative counts. The :class:`Counter`

‎Doc/library/configparser.rst

Copy file name to clipboardExpand all lines: Doc/library/configparser.rst
+23-23Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ Let's take a very basic configuration file that looks like this:
6969
CompressionLevel = 9
7070
ForwardX11 = yes
7171
72-
[bitbucket.org]
72+
[forge.example]
7373
User = hg
7474
75-
[topsecret.server.com]
75+
[topsecret.server.example]
7676
Port = 50022
7777
ForwardX11 = no
7878
@@ -89,10 +89,10 @@ creating the above configuration file programmatically.
8989
>>> config['DEFAULT'] = {'ServerAliveInterval': '45',
9090
... 'Compression': 'yes',
9191
... 'CompressionLevel': '9'}
92-
>>> config['bitbucket.org'] = {}
93-
>>> config['bitbucket.org']['User'] = 'hg'
94-
>>> config['topsecret.server.com'] = {}
95-
>>> topsecret = config['topsecret.server.com']
92+
>>> config['forge.example'] = {}
93+
>>> config['forge.example']['User'] = 'hg'
94+
>>> config['topsecret.server.example'] = {}
95+
>>> topsecret = config['topsecret.server.example']
9696
>>> topsecret['Port'] = '50022' # mutates the parser
9797
>>> topsecret['ForwardX11'] = 'no' # same here
9898
>>> config['DEFAULT']['ForwardX11'] = 'yes'
@@ -115,28 +115,28 @@ back and explore the data it holds.
115115
>>> config.read('example.ini')
116116
['example.ini']
117117
>>> config.sections()
118-
['bitbucket.org', 'topsecret.server.com']
119-
>>> 'bitbucket.org' in config
118+
['forge.example', 'topsecret.server.example']
119+
>>> 'forge.example' in config
120120
True
121-
>>> 'bytebong.com' in config
121+
>>> 'python.org' in config
122122
False
123-
>>> config['bitbucket.org']['User']
123+
>>> config['forge.example']['User']
124124
'hg'
125125
>>> config['DEFAULT']['Compression']
126126
'yes'
127-
>>> topsecret = config['topsecret.server.com']
127+
>>> topsecret = config['topsecret.server.example']
128128
>>> topsecret['ForwardX11']
129129
'no'
130130
>>> topsecret['Port']
131131
'50022'
132-
>>> for key in config['bitbucket.org']: # doctest: +SKIP
132+
>>> for key in config['forge.example']: # doctest: +SKIP
133133
... print(key)
134134
user
135135
compressionlevel
136136
serveraliveinterval
137137
compression
138138
forwardx11
139-
>>> config['bitbucket.org']['ForwardX11']
139+
>>> config['forge.example']['ForwardX11']
140140
'yes'
141141

142142
As we can see above, the API is pretty straightforward. The only bit of magic
@@ -154,15 +154,15 @@ configuration while the previously existing keys are retained.
154154
>>> another_config = configparser.ConfigParser()
155155
>>> another_config.read('example.ini')
156156
['example.ini']
157-
>>> another_config['topsecret.server.com']['Port']
157+
>>> another_config['topsecret.server.example']['Port']
158158
'50022'
159-
>>> another_config.read_string("[topsecret.server.com]\nPort=48484")
160-
>>> another_config['topsecret.server.com']['Port']
159+
>>> another_config.read_string("[topsecret.server.example]\nPort=48484")
160+
>>> another_config['topsecret.server.example']['Port']
161161
'48484'
162-
>>> another_config.read_dict({"topsecret.server.com": {"Port": 21212}})
163-
>>> another_config['topsecret.server.com']['Port']
162+
>>> another_config.read_dict({"topsecret.server.example": {"Port": 21212}})
163+
>>> another_config['topsecret.server.example']['Port']
164164
'21212'
165-
>>> another_config['topsecret.server.com']['ForwardX11']
165+
>>> another_config['topsecret.server.example']['ForwardX11']
166166
'no'
167167

168168
This behaviour is equivalent to a :meth:`ConfigParser.read` call with several
@@ -195,9 +195,9 @@ recognizes Boolean values from ``'yes'``/``'no'``, ``'on'``/``'off'``,
195195

196196
>>> topsecret.getboolean('ForwardX11')
197197
False
198-
>>> config['bitbucket.org'].getboolean('ForwardX11')
198+
>>> config['forge.example'].getboolean('ForwardX11')
199199
True
200-
>>> config.getboolean('bitbucket.org', 'Compression')
200+
>>> config.getboolean('forge.example', 'Compression')
201201
True
202202

203203
Apart from :meth:`~ConfigParser.getboolean`, config parsers also
@@ -224,7 +224,7 @@ provide fallback values:
224224
Please note that default values have precedence over fallback values.
225225
For instance, in our example the ``'CompressionLevel'`` key was
226226
specified only in the ``'DEFAULT'`` section. If we try to get it from
227-
the section ``'topsecret.server.com'``, we will always get the default,
227+
the section ``'topsecret.server.example'``, we will always get the default,
228228
even if we specify a fallback:
229229

230230
.. doctest::
@@ -239,7 +239,7 @@ the ``fallback`` keyword-only argument:
239239

240240
.. doctest::
241241

242-
>>> config.get('bitbucket.org', 'monster',
242+
>>> config.get('forge.example', 'monster',
243243
... fallback='No such things as monsters')
244244
'No such things as monsters'
245245

‎Doc/library/datetime.rst

Copy file name to clipboardExpand all lines: Doc/library/datetime.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` typ
160160
share these common features:
161161

162162
- Objects of these types are immutable.
163-
- Objects of these types are hashable, meaning that they can be used as
163+
- Objects of these types are :term:`hashable`, meaning that they can be used as
164164
dictionary keys.
165165
- Objects of these types support efficient pickling via the :mod:`pickle` module.
166166

‎Doc/library/dis.rst

Copy file name to clipboardExpand all lines: Doc/library/dis.rst
+15-11Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -768,16 +768,6 @@ iterations of the loop.
768768

769769
.. versionadded:: 3.11
770770

771-
.. opcode:: PREP_RERAISE_STAR
772-
773-
Combines the raised and reraised exceptions list from ``STACK[-1]``, into an
774-
exception group to propagate from a try-except* block. Uses the original exception
775-
group from ``STACK[-2]`` to reconstruct the structure of reraised exceptions. Pops
776-
two items from the stack and pushes the exception to reraise or ``None``
777-
if there isn't one.
778-
779-
.. versionadded:: 3.11
780-
781771
.. opcode:: WITH_EXCEPT_START
782772

783773
Calls the function in position 4 on the stack with arguments (type, val, tb)
@@ -1515,7 +1505,8 @@ iterations of the loop.
15151505
.. opcode:: CALL_INTRINSIC_1
15161506

15171507
Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the
1518-
argument and sets ``STACK[-1]`` to the result. Used to implement functionality that is necessary but not performance critical.
1508+
argument and sets ``STACK[-1]`` to the result. Used to implement
1509+
functionality that is necessary but not performance critical.
15191510

15201511
The operand determines which intrinsic function is called:
15211512

@@ -1529,6 +1520,19 @@ iterations of the loop.
15291520

15301521
.. versionadded:: 3.12
15311522

1523+
.. opcode:: CALL_INTRINSIC_2
1524+
1525+
Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, ``STACK[-1]`` as the
1526+
arguments and sets ``STACK[-1]`` to the result. Used to implement functionality that is
1527+
necessary but not performance critical.
1528+
1529+
The operand determines which intrinsic function is called:
1530+
1531+
* ``0`` Not valid
1532+
* ``1`` Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``.
1533+
1534+
.. versionadded:: 3.12
1535+
15321536

15331537
**Pseudo-instructions**
15341538

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.