8000 Merge branch main into main-slp · stackless-dev/stackless@4016dd5 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 4016dd5

Browse files
author
Anselm Kruis
committed
Merge branch main into main-slp
2 parents ab63077 + 307d4cb commit 4016dd5

File tree

87 files changed

+1313
-1593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1313
-1593
lines changed

.github/appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 3.8build{build}
1+
version: 3.9build{build}
22
clone_depth: 5
33
branches:
44
only:

Doc/c-api/long.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
288288
If the value of *obj* is out of range for an :c:type:`unsigned long`,
289289
return the reduction of that value modulo ``ULONG_MAX + 1``.
290290
291-
Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
291+
Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to
292+
disambiguate.
292293
293294
.. versionchanged:: 3.8
294295
Use :meth:`__index__` if available.
@@ -307,7 +308,8 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
307308
If the value of *obj* is out of range for an :c:type:`unsigned long long`,
308309
return the reduction of that value modulo ``PY_ULLONG_MAX + 1``.
309310
310-
Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
311+
Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred`
312+
to disambiguate.
311313
312314
.. versionchanged:: 3.8
313315
Use :meth:`__index__` if available.

Doc/library/bdb.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ The :mod:`bdb` module also defines two classes:
343343

344344
For backwards compatibility. Calls the :meth:`run` method.
345345

346-
.. method:: runcall(func, *args, **kwds)
346+
.. method:: runcall(func, /, *args, **kwds)
347347

348348
Debug a single function call, and return its result.
349349

Doc/library/codecs.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,8 @@ particular, the following variants typically exist:
11981198
+-----------------+--------------------------------+--------------------------------+
11991199
| mac_iceland | maciceland | Icelandic |
12001200
+-----------------+--------------------------------+--------------------------------+
1201-
| mac_latin2 | maclatin2, maccentraleurope | Central and Eastern Europe |
1201+
| mac_latin2 | maclatin2, maccentraleurope, | Central and Eastern Europe |
1202+
| | mac_centeuro | |
12021203
+-----------------+--------------------------------+--------------------------------+
12031204
| mac_roman | macroman, macintosh | Western Europe |
12041205
+-----------------+--------------------------------+--------------------------------+

Doc/library/concurrent.futures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Executor Objects
2828
An abstract class that provides methods to execute calls asynchronously. It
2929
should not be used directly, but through its concrete subclasses.
3030

31-
.. method:: submit(fn, *args, **kwargs)
31+
.. method:: submit(fn, /, *args, **kwargs)
3232

3333
Schedules the callable, *fn*, to be executed as ``fn(*args **kwargs)``
3434
and returns a :class:`Future` object representing the execution of the

Doc/library/contextlib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ Functions and classes provided:
416416
The passed in object is returned from the function, allowing this
417417
method to be used as a function decorator.
418418

419-
.. method:: callback(callback, *args, **kwds)
419+
.. method:: callback(callback, /, *args, **kwds)
420420

421421
Accepts an arbitrary callback function and arguments and adds it to
422422
the callback stack.
@@ -473,7 +473,7 @@ Functions and classes provided:
473473
Similar to :meth:`push` but expects either an asynchronous context manager
474474
or a coroutine function.
475475

476-
.. method:: push_async_callback(callback, *args, **kwds)
476+
.. method:: push_async_callback(callback, /, *args, **kwds)
477477

478478
Similar to :meth:`callback` but expects a coroutine function.
479479

Doc/library/curses.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ The module :mod:`curses` defines the following functions:
656656
foreground color on the default background.
657657

658658

659-
.. function:: wrapper(func, ...)
659+
.. function:: wrapper(func, /, *args, **kwargs)
660660

661661
Initialize curses and call another callable object, *func*, which should be the
662662
rest of your curses-using application. If the application raises an exception,

Doc/library/functions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,11 +1562,11 @@ are always available. They are listed here in alphabetical order.
15621562
about strings, see :ref:`textseq`.
15631563

15641564

1565-
.. function:: sum(iterable[, start])
1565+
.. function:: sum(iterable, /, start=0)
15661566

15671567
Sums *start* and the items of an *iterable* from left to right and returns the
1568-
total. *start* defaults to ``0``. The *iterable*'s items are normally numbers,
1569-
and the start value is not allowed to be a string.
1568+
total. The *iterable*'s items are normally numbers, and the start value is not
1569+
allowed to be a string.
15701570

15711571
For some use cases, there are good alternatives to :func:`sum`.
15721572
The preferred, fast way to concatenate a sequence of strings is by calling

Doc/library/multiprocessing.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ to start a process. These *start methods* are
126126

127127
.. versionchanged:: 3.8
128128

129-
On macOS, *spawn* start method is now the default: *fork* start method is no
130-
longer reliable on macOS, see :issue:`33725`.
129+
On macOS, the *spawn* start method is now the default. The *fork* start
130+
method should be considered unsafe as it can lead to crashes of the
131+
subprocess. See :issue:`33725`.
131132

132133
.. versionchanged:: 3.4
133134
*spawn* added on all unix platforms, and *forkserver* added for
@@ -2279,6 +2280,10 @@ with the :class:`Pool` class.
22792280
Return whether the call completed without raising an exception. Will
22802281
raise :exc:`AssertionError` if the result is not ready.
22812282

2283+
.. versionchanged:: 3.7
2284+
If the result is not ready, :exc:`ValueError` is raised instead of
2285+
:exc:`AssertionError`.
2286+
22822287
The following example demonstrates the use of a pool::
22832288

22842289
from multiprocessing import Pool

Doc/library/os.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3011,6 +3011,13 @@ features:
30113011
(or a bitwise ORed combination of them). By default, the new file
30123012
descriptor is :ref:`non-inheritable <fd_inheritance>`.
30133013

3014+
The name supplied in *name* is used as a filename and will be displayed as
3015+
the target of the corresponding symbolic link in the directory
3016+
``/proc/self/fd/``. The displayed name is always prefixed with ``memfd:``
3017+
and serves only for debugging purposes. Names do not affect the behavior of
3018+
the file descriptor, and as such multiple files can have the same name
3019+
without any side effects.
3020+
30143021
.. availability:: Linux 3.17 or newer with glibc 2.27 or newer.
30153022

30163023
.. versionadded:: 3.8

Doc/library/profile.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ functions:
309309
Profile the cmd via :func:`exec` with the specified global and
310310
local environment.
311311

312-
.. method:: runcall(func, *args, **kwargs)
312+
.. method:: runcall(func, /, *args, **kwargs)
313313

314314
Profile ``func(*args, **kwargs)``
315315

Doc/library/stdtypes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,8 +2736,8 @@ arbitrary binary data.
27362736
The prefix(es) to search for may be any :term:`bytes-like object`.
27372737

27382738

2739-
.. method:: bytes.translate(table, delete=b'')
2740-
bytearray.translate(table, delete=b'')
2739+
.. method:: bytes.translate(table, /, delete=b'')
2740+
bytearray.translate(table, /, delete=b'')
27412741

27422742
Return a copy of the bytes or bytearray object where all bytes occurring in
27432743
the optional argument *delete* are removed, and the remaining bytes have

Doc/library/struct.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The module defines the following exception and functions:
7070
size required by the format, as reflected by :func:`calcsize`.
7171

7272

73-
.. function:: unpack_from(format, buffer, offset=0)
73+
.. function:: unpack_from(format, /, buffer, offset=0)
7474

7575
Unpack from *buffer* starting at position *offset*, according to the format
7676
string *format*. The result is a tuple even if it contains exactly one

Doc/library/trace.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Programmatic Interface
166166
environments. If not defined, *globals* and *locals* default to empty
167167
dictionaries.
168168

169-
.. method:: runfunc(func, *args, **kwds)
169+
.. method:: runfunc(func, /, *args, **kwds)
170170

171171
Call *func* with the given arguments under control of the :class:`Trace`
172172
object with the current tracing parameters.

Doc/library/unittest.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ Test cases
14271427
:class:`TextTestResult` in Python 3.2.
14281428

14291429

1430-
.. method:: addCleanup(function, *args, **kwargs)
1430+
.. method:: addCleanup(function, /, *args, **kwargs)
14311431

14321432
Add a function to be called after :meth:`tearDown` to cleanup resources
14331433
used during the test. Functions will be called in reverse order to the

Doc/library/weakref.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ objects.
240240

241241
.. versionadded:: 3.4
242242

243-
.. class:: finalize(obj, func, *args, **kwargs)
243+
.. class:: finalize(obj, func, /, *args, **kwargs)
244244

245245
Return a callable finalizer object which will be called when *obj*
246246
is garbage collected. Unlike an ordinary weak reference, a finalizer

Doc/library/zlib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The available exception and functions in this module are:
4747
platforms, use ``adler32(data) & 0xffffffff``.
4848

4949

50-
.. function:: compress(data, level=-1)
50+
.. function:: compress(data, /, level=-1)
5151

5252
Compresses the bytes in *data*, returning a bytes object containing compressed data.
5353
*level* is an integer from ``0`` to ``9`` or ``-1`` controlling the level of compression;
@@ -132,7 +132,7 @@ The available exception and functions in this module are:
132132
platforms, use ``crc32(data) & 0xffffffff``.
133133

134134

135-
.. function:: decompress(data, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE)
135+
.. function:: decompress(data, /, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE)
136136

137137
Decompresses the bytes in *data*, returning a bytes object containing the
138138
uncompressed data. The *wbits* parameter depends on

Doc/tools/extensions/pyspecific.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737

3838
ISSUE_URI = 'https://bugs.python.org/issue%s'
39-
SOURCE_URI = 'https://github.com/python/cpython/tree/3.8/%s'
39+
SOURCE_URI = 'https://github.com/python/cpython/tree/master/%s'
4040

4141
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
4242
from docutils.parsers.rst.states import Body

Doc/tools/static/switchers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
'(?:release/\\d.\\d[\\x\\d\\.]*)'];
1111

1212
var all_versions = {
13-
'3.8': 'dev (3.8)',
13+
'3.9': 'dev (3.9)',
14+
'3.8': 'pre (3.8)',
1415
'3.7': '3.7',
1516
'3.6': '3.6',
1617
'3.5': '3.5',

Doc/tools/templates/indexsidebar.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ <h3>{% trans %}Download{% endtrans %}</h3>
22
<p><a href="{{ pathto('download') }}">{% trans %}Download these documents{% endtrans %}</a></p>
33
<h3>{% trans %}Docs by version{% endtrans %}</h3>
44
<ul>
5-
<li><a href="https://docs.python.org/3.8/">{% trans %}Python 3.8 (in development){% endtrans %}</a></li>
5+
<li><a href="https://docs.python.org/3.9/">{% trans %}Python 3.9 (in development){% endtrans %}</a></li>
6+
<li><a href="https://docs.python.org/3.8/">{% trans %}Python 3.8 (pre-release){% endtrans %}</a></li>
67
<li><a href="https://docs.python.org/3.7/">{% trans %}Python 3.7 (stable){% endtrans %}</a></li>
78
<li><a href="https://docs.python.org/3.6/">{% trans %}Python 3.6 (security-fixes){% endtrans %}</a></li>
89
<li><a href="https://docs.python.org/3.5/">{% trans %}Python 3.5 (security-fixes){% endtrans %}</a></li>

Doc/tutorial/interpreter.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ Using the Python Interpreter
1010
Invoking the Interpreter
1111
========================
1212

13-
The Python interpreter is usually installed as :file:`/usr/local/bin/python3.8`
13+
The Python interpreter is usually installed as :file:`/usr/local/bin/python3.9`
1414
on those machines where it is available; putting :file:`/usr/local/bin` in your
1515
Unix shell's search path makes it possible to start it by typing the command:
1616

1717
.. code-block:: text
1818
19-
python3.8
19+
python3.9
2020
2121
to the shell. [#]_ Since the choice of the directory where the interpreter lives
2222
is an installation option, other places are possible; check with your local
@@ -98,8 +98,8 @@ before printing the first prompt:
9898

9999
.. code-block:: shell-session
100100
101-
$ python3.8
102-
Python 3.8 (default, Sep 16 2015, 09:25:04)
101+
$ python3.9
102+
Python 3.9 (default, June 4 2019, 09:25:04)
103103
[GCC 4.8.2] on linux
104104
Type "help", "copyright", "credits" or "license" for more information.
105105
>>>

Doc/tutorial/stdlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ operating system::
1515

1616
>>> import os
1717
>>> os.getcwd() # Return the current working directory
18-
'C:\\Python38'
18+
'C:\\Python39'
1919
>>> os.chdir('/server/accesslogs') # Change current working directory
2020
>>> os.system('mkdir today') # Run the command mkdir in the system shell
2121
0

Doc/tutorial/stdlib2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ applications include caching objects that are expensive to create::
278278
Traceback (most recent call last):
279279
File "<stdin>", line 1, in <module>
280280
d['primary'] # entry was automatically removed
281-
File "C:/python38/lib/weakref.py", line 46, in __getitem__
281+
File "C:/python39/lib/weakref.py", line 46, in __getitem__
282282
o = self.data[key]()
283283
KeyError: 'primary'
284284

Doc/whatsnew/3.8.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,10 @@ Other Language Changes
330330
New Modules
331331
===========
332332

333-
* None yet.
333+
* The new :mod:`importlib.metadata` module provides (provisional) support for
334+
reading metadata from third-party packages. For example, you can extract an
335+
installed package's version number, list of entry points, and more. See
336+
:issue:`34632` for additional details.
334337

335338

336339
Improved Modules

Include/patchlevel.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
/* Version parsed out into numeric values */
1818
/*--start constants--*/
1919
#define PY_MAJOR_VERSION 3
20-
#define PY_MINOR_VERSION 8
20+
#define PY_MINOR_VERSION 9
2121
#define PY_MICRO_VERSION 0
22-
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA
23-
#define PY_RELEASE_SERIAL 1
22+
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
23+
#define PY_RELEASE_SERIAL 0
2424

2525
/* Version as a string */
26-
#define PY_VERSION "3.8.0b1"
26+
#define PY_VERSION "3.9.0a0"
2727
/*--end constants--*/
2828

2929
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.

Lib/asyncio/locks.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class Lock(_ContextManagerMixin):
158158
"""
159159

160160
def __init__(self, *, loop=None):
161-
self._waiters = collections.deque()
161+
self._waiters = None
162162
self._locked = False
163163
if loop is not None:
164164
self._loop = loop
@@ -182,10 +182,13 @@ async def acquire(self):
182182
This method blocks until the lock is unlocked, then sets it to
183183
locked and returns True.
184184
"""
185-
if not self._locked and all(w.cancelled() for w in self._waiters):
185+
if (not self._locked and (self._waiters is None or
186+
all(w.cancelled() for w in self._waiters))):
186187
self._locked = True
187188
return True
188189

190+
if self._waiters is None:
191+
self._waiters = collections.deque()
189192
fut = self._loop.create_future()
190193
self._waiters.append(fut)
191194

@@ -224,6 +227,8 @@ def release(self):
224227

225228
def _wake_up_first(self):
226229
"""Wake up the first waiter if it isn't done."""
230+
if not self._waiters:
231+
return
227232
try:
228233
fut = next(iter(self._waiters))
229234
except StopIteration:

Lib/asyncio/streams.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ async def open_connection(host=None, port=None, *,
175175
stacklevel=2)
176176
if loop is None:
177177
loop = events.get_event_loop()
178+
else:
179+
warnings.warn("The loop argument is deprecated since Python 3.8, "
180+
"and scheduled for removal in Python 3.10.",
181+
DeprecationWarning, stacklevel=2)
178182
reader = StreamReader(limit=limit, loop=loop)
179183
protocol = StreamReaderProtocol(reader, loop=loop, _asyncio_internal=True)
180184
transport, _ = await loop.create_connection(
@@ -213,6 +217,10 @@ async def start_server(client_connected_cb, host=None, port=None, *,
213217
stacklevel=2)
214218
if loop is None:
215219
loop = events.get_event_loop()
220+
else:
221+
warnings.warn("The loop argument is deprecated since Python 3.8, "
222+
"and scheduled for removal in Python 3.10.",
223+
DeprecationWarning, stacklevel=2)
216224

217225
def factory():
218226
reader = StreamReader(limit=limit, loop=loop)
@@ -414,6 +422,10 @@ async def open_unix_connection(path=None, *,
414422
stacklevel=2)
415423
if loop is None:
416424
loop = events.get_event_loop()
425+
else:
426+
warnings.warn("The loop argument is deprecated since Python 3.8, "
427+
"and scheduled for removal in Python 3.10.",
428+
DeprecationWarning, stacklevel=2)
417429
reader = StreamReader(limit=limit, loop=loop)
418430
protocol = StreamReaderProtocol(reader, loop=loop,
419431
_asyncio_internal=True)
@@ -473,6 +485,10 @@ async def start_unix_server(client_connected_cb, path=None, *,
473485
stacklevel=2)
474486
if loop is None:
475487
loop = events.get_event_loop()
488+
else:
489+
warnings.warn("The loop argument is deprecated since Python 3.8, "
490+
"and scheduled for removal in Python 3.10.",
491+
DeprecationWarning, stacklevel=2)
476492

477493
def factory():
478494
reader = StreamReader(limit=limit, loop=loop)

0 commit comments

Comments
 (0)
0