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 7848c65

Browse filesBrowse files
Merge branch 'python:main' into main
2 parents 16a1c87 + 63842bd commit 7848c65
Copy full SHA for 7848c65

Some content is hidden

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

58 files changed

+980
-187
lines changed

‎.github/CODEOWNERS

Copy file name to clipboardExpand all lines: .github/CODEOWNERS
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
configure* @erlend-aasland @corona10
1212

1313
# asyncio
14-
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303
14+
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303 @willingc
1515

1616
# Core
1717
**/*context* @1st1

‎.github/workflows/doc.yml

Copy file name to clipboardExpand all lines: .github/workflows/doc.yml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ jobs:
5656

5757
# Add pull request annotations for Sphinx nitpicks (missing references)
5858
- name: 'Get list of changed files'
59+
if: github.event_name == 'pull_request'
5960
id: changed_files
6061
uses: Ana06/get-changed-files@v2.2.0
6162
with:
6263
filter: "Doc/**"
6364
- name: 'Build changed files in nit-picky mode'
65+
if: github.event_name == 'pull_request'
6466
continue-on-error: true
6567
run: |
6668
# Mark files the pull request modified

‎Doc/c-api/unicode.rst

Copy file name to clipboardExpand all lines: Doc/c-api/unicode.rst
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,15 @@ APIs:
509509
arguments.
510510
511511
512+
.. c:function:: PyObject* PyUnicode_FromObject(PyObject *obj)
513+
514+
Copy an instance of a Unicode subtype to a new true Unicode object if
515+
necessary. If *obj* is already a true Unicode object (not a subtype),
516+
return the reference with incremented refcount.
517+
518+
Objects other than Unicode or its subtypes will cause a :exc:`TypeError`.
519+
520+
512521
.. c:function:: PyObject* PyUnicode_FromEncodedObject(PyObject *obj, \
513522
const char *encoding, const char *errors)
514523
@@ -616,15 +625,6 @@ APIs:
616625
.. versionadded:: 3.3
617626
618627
619-
.. c:function:: PyObject* PyUnicode_FromObject(PyObject *obj)
620-
621-
Copy an instance of a Unicode subtype to a new true Unicode object if
622-
necessary. If *obj* is already a true Unicode object (not a subtype),
623-
return the reference with incremented refcount.
624-
625-
Objects other than Unicode or its subtypes will cause a :exc:`TypeError`.
626-
627-
628628
Locale Encoding
629629
"""""""""""""""
630630

‎Doc/constraints.txt

Copy file name to clipboard
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# We have upper bounds on our transitive dependencies here
2+
# To avoid new releases unexpectedly breaking our build.
3+
# This file can be updated on an ad-hoc basis,
4+
# though it will probably have to be updated
5+
# whenever Doc/requirements.txt is updated.
6+
7+
# Direct dependencies of Sphinx
8+
babel<3
9+
colorama<0.5
10+
imagesize<1.5
11+
Jinja2<3.2
12+
packaging<24
13+
# Pygments==2.15.0 breaks CI
14+
Pygments<2.16,!=2.15.0
15+
requests<3
16+
snowballstemmer<3
17+
sphinxcontrib-applehelp<1.1
18+
sphinxcontrib-devhelp<1.1
19+
sphinxcontrib-htmlhelp<2.1
20+
sphinxcontrib-jsmath<1.1
21+
sphinxcontrib-qthelp<1.1
22+
sphinxcontrib-serializinghtml<1.2
23+
24+
# Direct dependencies of Jinja2 (Jinja is a dependency of Sphinx, see above)
25+
MarkupSafe<2.2
26+
27+
# Direct dependencies of sphinx-lint
28+
polib<1.3
29+
regex<2024

‎Doc/library/asyncio-eventloop.rst

Copy file name to clipboardExpand all lines: Doc/library/asyncio-eventloop.rst
+8-9Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,9 +1438,7 @@ async/await code consider using the high-level
14381438

14391439
* *stdin* can be any of these:
14401440

1441-
* a file-like object representing a pipe to be connected to the
1442-
subprocess's standard input stream using
1443-
:meth:`~loop.connect_write_pipe`
1441+
* a file-like object
14441442
* the :const:`subprocess.PIPE` constant (default) which will create a new
14451443
pipe and connect it,
14461444
* the value ``None`` which will make the subprocess inherit the file
@@ -1450,9 +1448,7 @@ async/await code consider using the high-level
14501448

14511449
* *stdout* can be any of these:
14521450

1453-
* a file-like object representing a pipe to be connected to the
1454-
subprocess's standard output stream using
1455-
:meth:`~loop.connect_write_pipe`
1451+
* a file-like object
14561452
* the :const:`subprocess.PIPE` constant (default) which will create a new
14571453
pipe and connect it,
14581454
* the value ``None`` which will make the subprocess inherit the file
@@ -1462,9 +1458,7 @@ async/await code consider using the high-level
14621458

14631459
* *stderr* can be any of these:
14641460

1465-
* a file-like object representing a pipe to be connected to the
1466-
subprocess's standard error stream using
1467-
:meth:`~loop.connect_write_pipe`
1461+
* a file-like object
14681462
* the :const:`subprocess.PIPE` constant (default) which will create a new
14691463
pipe and connect it,
14701464
* the value ``None`` which will make the subprocess inherit the file
@@ -1483,6 +1477,11 @@ async/await code consider using the high-level
14831477
as text. :func:`bytes.decode` can be used to convert the bytes returned
14841478
from the stream to text.
14851479

1480+
If a file-like object passed as *stdin*, *stdout* or *stderr* represents a
1481+
pipe, then the other side of this pipe should be registered with
1482+
:meth:`~loop.connect_write_pipe` or :meth:`~loop.connect_read_pipe` for use
1483+
with the event loop.
1484+
14861485
See the constructor of the :class:`subprocess.Popen` class
14871486
for documentation on other arguments.
14881487

‎Doc/library/smtplib.rst

Copy file name to clipboardExpand all lines: Doc/library/smtplib.rst
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
2525

2626
An :class:`SMTP` instance encapsulates an SMTP connection. It has methods
2727
that support a full repertoire of SMTP and ESMTP operations. If the optional
28-
host and port parameters are given, the SMTP :meth:`connect` method is
28+
*host* and *port* parameters are given, the SMTP :meth:`connect` method is
2929
called with those parameters during initialization. If specified,
3030
*local_hostname* is used as the FQDN of the local host in the HELO/EHLO
3131
command. Otherwise, the local hostname is found using
@@ -34,12 +34,12 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
3434
*timeout* parameter specifies a timeout in seconds for blocking operations
3535
like the connection attempt (if not specified, the global default timeout
3636
setting will be used). If the timeout expires, :exc:`TimeoutError` is
37-
raised. The optional source_address parameter allows binding
37+
raised. The optional *source_address* parameter allows binding
3838
to some specific source address in a machine with multiple network
3939
interfaces, and/or to some specific source TCP port. It takes a 2-tuple
40-
(host, port), for the socket to bind to as its source address before
41-
connecting. If omitted (or if host or port are ``''`` and/or 0 respectively)
42-
the OS default behavior will be used.
40+
``(host, port)``, for the socket to bind to as its source address before
41+
connecting. If omitted (or if *host* or *port* are ``''`` and/or ``0``
42+
respectively) the OS default behavior will be used.
4343

4444
For normal use, you should only require the initialization/connect,
4545
:meth:`sendmail`, and :meth:`SMTP.quit` methods.

‎Doc/library/sqlite3.rst

Copy file name to clipboardExpand all lines: Doc/library/sqlite3.rst
+76-2Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,38 @@ Module constants
573573
package, a third-party library which used to upstream changes to
574574
:mod:`!sqlite3`. Today, it carries no meaning or practical value.
575575

576+
.. _sqlite3-dbconfig-constants:
577+
578+
.. data:: SQLITE_DBCONFIG_DEFENSIVE
579+
SQLITE_DBCONFIG_DQS_DDL
580+
SQLITE_DBCONFIG_DQS_DML
581+
SQLITE_DBCONFIG_ENABLE_FKEY
582+
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
583+
SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
584+
SQLITE_DBCONFIG_ENABLE_QPSG
585+
SQLITE_DBCONFIG_ENABLE_TRIGGER
586+
SQLITE_DBCONFIG_ENABLE_VIEW
587+
SQLITE_DBCONFIG_LEGACY_ALTER_TABLE
588+
SQLITE_DBCONFIG_LEGACY_FILE_FORMAT
589+
SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
590+
SQLITE_DBCONFIG_RESET_DATABASE
591+
SQLITE_DBCONFIG_TRIGGER_EQP
592+
SQLITE_DBCONFIG_TRUSTED_SCHEMA
593+
SQLITE_DBCONFIG_WRITABLE_SCHEMA
594+
595+
These constants are used for the :meth:`Connection.setconfig`
596+
and :meth:`~Connection.getconfig` methods.
597+
598+
The availability of these constants varies depending on the version of SQLite
599+
Python was compiled with.
600+
601+
.. versionadded:: 3.12
602+
603+
.. seealso::
604+
605+
https://www.sqlite.org/c3ref/c_dbconfig_defensive.html
606+
SQLite docs: Database Connection Configuration Options
607+
576608

577609
.. _sqlite3-connection-objects:
578610

@@ -1041,19 +1073,37 @@ Connection objects
10411073
(2, 'broccoli pie', 'broccoli cheese onions flour')
10421074
(3, 'pumpkin pie', 'pumpkin sugar flour butter')
10431075

1044-
.. method:: load_extension(path, /)
1076+
.. method:: load_extension(path, /, *, entrypoint=None)
10451077

1046-
Load an SQLite extension from a shared library located at *path*.
1078+
Load an SQLite extension from a shared library.
10471079
Enable extension loading with :meth:`enable_load_extension` before
10481080
calling this method.
10491081

1082+
:param str path:
1083+
1084+
The path to the SQLite extension.
1085+
1086+
:param entrypoint:
1087+
1088+
Entry point name.
1089+
If ``None`` (the default),
1090+
SQLite will come up with an entry point name of its own;
1091+
see the SQLite docs `Loading an Extension`_ for details.
1092+
1093+
:type entrypoint: str | None
1094+
10501095
.. audit-event:: sqlite3.load_extension connection,path sqlite3.Connection.load_extension
10511096

10521097
.. versionadded:: 3.2
10531098

10541099
.. versionchanged:: 3.10
10551100
Added the ``sqlite3.load_extension`` auditing event.
10561101

1102+
.. versionadded:: 3.12
1103+
The *entrypoint* parameter.
1104+
1105+
.. _Loading an Extension: https://www.sqlite.org/loadext.html#loading_an_extension_
1106+
10571107
.. method:: iterdump
10581108

10591109
Return an :term:`iterator` to dump the database as SQL source code.
@@ -1201,6 +1251,30 @@ Connection objects
12011251
.. _SQLite limit category: https://www.sqlite.org/c3ref/c_limit_attached.html
12021252

12031253

1254+
.. method:: getconfig(op, /)
1255+
1256+
Query a boolean connection configuration option.
1257+
1258+
:param int op:
1259+
A :ref:`SQLITE_DBCONFIG code <sqlite3-dbconfig-constants>`.
1260+
1261+
:rtype: bool
1262+
1263+
.. versionadded:: 3.12
1264+
1265+
.. method:: setconfig(op, enable=True, /)
1266+
1267+
Set a boolean connection configuration option.
1268+
1269+
:param int op:
1270+
A :ref:`SQLITE_DBCONFIG code <sqlite3-dbconfig-constants>`.
1271+
1272+
:param bool enable:
1273+
``True`` if the configuration option should be enabled (default);
1274+
``False`` if it should be disabled.
1275+
1276+
.. versionadded:: 3.12
1277+
12041278
.. method:: serialize(*, name="main")
12051279

12061280
Serialize a database into a :class:`bytes` object. For an

‎Doc/library/typing.rst

Copy file name to clipboardExpand all lines: Doc/library/typing.rst
+22-2Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ annotations. These include:
9898
*Introducing* :data:`LiteralString`
9999
* :pep:`681`: Data Class Transforms
100100
*Introducing* the :func:`@dataclass_transform<dataclass_transform>` decorator
101+
* :pep:`692`: Using ``TypedDict`` for more precise ``**kwargs`` typing
102+
*Introducing* a new way of typing ``**kwargs`` with :data:`Unpack` and
103+
:data:`TypedDict`
101104
* :pep:`698`: Adding an override decorator to typing
102105
*Introducing* the :func:`@override<override>` decorator
103106

@@ -1417,8 +1420,10 @@ These are not used in annotations. They are building blocks for creating generic
14171420
tup: tuple[Unpack[Ts]]
14181421

14191422
In fact, ``Unpack`` can be used interchangeably with ``*`` in the context
1420-
of types. You might see ``Unpack`` being used explicitly in older versions
1421-
of Python, where ``*`` couldn't be used in certain places::
1423+
of :class:`typing.TypeVarTuple <TypeVarTuple>` and
1424+
:class:`builtins.tuple <tuple>` types. You might see ``Unpack`` being used
1425+
explicitly in older versions of Python, where ``*`` couldn't be used in
1426+
certain places::
14221427

14231428
# In older versions of Python, TypeVarTuple and Unpack
14241429
# are located in the `typing_extensions` backports package.
@@ -1428,6 +1433,21 @@ These are not used in annotations. They are building blocks for creating generic
14281433
tup: tuple[*Ts] # Syntax error on Python <= 3.10!
14291434
tup: tuple[Unpack[Ts]] # Semantically equivalent, and backwards-compatible
14301435

1436+
``Unpack`` can also be used along with :class:`typing.TypedDict` for typing
1437+
``**kwargs`` in a function signature::
1438+
1439+
from typing import TypedDict, Unpack
1440+
1441+
class Movie(TypedDict):
1442+
name: str
1443+
year: int
1444+
1445+
# This function expects two keyword arguments - `name` of type `str`
1446+
# and `year` of type `int`.
1447+
def foo(**kwargs: Unpack[Movie]): ...
1448+
1449+
See :pep:`692` for more details on using ``Unpack`` for ``**kwargs`` typing.
1450+
14311451
.. versionadded:: 3.11
14321452

14331453
.. class:: ParamSpec(name, *, bound=None, covariant=False, contravariant=False)

‎Doc/library/unittest.rst

Copy file name to clipboardExpand all lines: Doc/library/unittest.rst
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2281,7 +2281,8 @@ Loading and running tests
22812281

22822282
The *testRunner* argument can either be a test runner class or an already
22832283
created instance of it. By default ``main`` calls :func:`sys.exit` with
2284-
an exit code indicating success or failure of the tests run.
2284+
an exit code indicating success (0) or failure (1) of the tests run.
2285+
An exit code of 5 indicates that no tests were run.
22852286

22862287
The *testLoader* argument has to be a :class:`TestLoader` instance,
22872288
and defaults to :data:`defaultTestLoader`.

‎Doc/library/urllib.request.rst

Copy file name to clipboardExpand all lines: Doc/library/urllib.request.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ The :mod:`urllib.request` module defines the following functions:
2828

2929
.. function:: urlopen(url, data=None[, timeout], *, cafile=None, capath=None, cadefault=False, context=None)
3030

31-
Open the URL *url*, which can be either a string or a
32-
:class:`Request` object.
31+
Open *url*, which can be either a string containing a valid, properly
32+
encoded URL, or a :class:`Request` object.
3333

3434
*data* must be an object specifying additional data to be sent to the
3535
server, or ``None`` if no such data is needed. See :class:`Request`
@@ -192,7 +192,7 @@ The following classes are provided:
192192

193193
This class is an abstraction of a URL request.
194194

195-
*url* should be a string containing a valid URL.
195+
*url* should be a string containing a valid, properly encoded URL.
196196

197197
*data* must be an object specifying additional data to send to the
198198
server, or ``None`` if no such data is needed. Currently HTTP

‎Doc/requirements.txt

Copy file name to clipboardExpand all lines: Doc/requirements.txt
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Requirements to build the Python documentation
2+
#
3+
# Note that when updating this file, you will likely also have to update
4+
# the Doc/constraints.txt file.
25

36
# Sphinx version is pinned so that new versions that introduce new warnings
47
# won't suddenly cause build failures. Updating the version is fine as long
@@ -13,3 +16,5 @@ sphinxext-opengraph==0.7.5
1316
# The theme used by the documentation is stored separately, so we need
1417
# to install that as well.
1518
python-docs-theme>=2022.1
19+
20+
-c constraints.txt

0 commit comments

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