Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb091af

Browse files
Pull in main
2 parents 997ccc6 + e5da9ab commit cb091af

63 files changed

Lines changed: 1719 additions & 737 deletions

Some content is hidden

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

Doc/library/http.client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ statement.
532532
.. deprecated:: 3.9
533533
Deprecated in favor of :attr:`~HTTPResponse.headers`.
534534

535-
.. method:: HTTPResponse.getstatus()
535+
.. method:: HTTPResponse.getcode()
536536

537537
.. deprecated:: 3.9
538538
Deprecated in favor of :attr:`~HTTPResponse.status`.

Doc/library/importlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ an :term:`importer`.
13871387

13881388
.. classmethod:: factory(loader)
13891389

1390-
A static method which returns a callable that creates a lazy loader. This
1390+
A class method which returns a callable that creates a lazy loader. This
13911391
is meant to be used in situations where the loader is passed by class
13921392
instead of by instance.
13931393
::

Doc/library/sqlite3.rst

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,15 +1418,26 @@ Cursor objects
14181418

14191419
.. method:: execute(sql, parameters=(), /)
14201420

1421-
Execute SQL statement *sql*.
1422-
Bind values to the statement using :ref:`placeholders
1423-
<sqlite3-placeholders>` that map to the :term:`sequence` or :class:`dict`
1424-
*parameters*.
1421+
Execute SQL a single SQL statement,
1422+
optionally binding Python values using
1423+
:ref:`placeholders <sqlite3-placeholders>`.
14251424

1426-
:meth:`execute` will only execute a single SQL statement. If you try to execute
1427-
more than one statement with it, it will raise a :exc:`ProgrammingError`. Use
1428-
:meth:`executescript` if you want to execute multiple SQL statements with one
1429-
call.
1425+
:param str sql:
1426+
A single SQL statement.
1427+
1428+
:param parameters:
1429+
Python values to bind to placeholders in *sql*.
1430+
A :class:`!dict` if named placeholders are used.
1431+
A :term:`!sequence` if unnamed placeholders are used.
1432+
See :ref:`sqlite3-placeholders`.
1433+
:type parameters: :class:`dict` | :term:`sequence`
1434+
1435+
:raises ProgrammingError:
1436+
If *sql* contains more than one SQL statement.
1437+
1438+
:raises DeprecationWarning:
1439+
If :ref:`named placeholders <sqlite3-placeholders>` are used
1440+
and *parameters* is a sequence.
14301441

14311442
If :attr:`~Connection.autocommit` is
14321443
:data:`LEGACY_TRANSACTION_CONTROL`,
@@ -1437,18 +1448,34 @@ Cursor objects
14371448

14381449
.. versionchanged:: 3.12
14391450

1440-
:exc:`DeprecationWarning` is raised if
1451+
:exc:`DeprecationWarning` is raised
1452+
if
14411453
:ref:`named placeholders <sqlite3-placeholders>` are used
14421454
and *parameters* is a sequence.
14431455

1456+
Use :meth:`executescript` to execute multiple SQL statements.
1457+
14441458
.. method:: executemany(sql, parameters, /)
14451459

1446-
Execute :ref:`parameterized <sqlite3-placeholders>` SQL statement *sql*
1447-
against all parameter sequences or mappings found in the sequence
1448-
*parameters*. It is also possible to use an
1449-
:term:`iterator` yielding parameters instead of a sequence.
1460+
For every item in *parameters*,
1461+
repeatedly execute the :ref:`parameterized <sqlite3-placeholders>`
1462+
SQL statement *sql*.
1463+
14501464
Uses the same implicit transaction handling as :meth:`~Cursor.execute`.
14511465

1466+
:param str sql:
1467+
A single SQL :abbr:`DML (Data Manipulation Language)` statement.
1468+
1469+
:param parameters:
1470+
An :term:`!iterable` of parameters to bind with
1471+
the placeholders in *sql*.
1472+
See :ref:`sqlite3-placeholders`.
1473+
:type parameters: :term:`iterable`
1474+
1475+
:raises ProgrammingError:
1476+
If *sql* contains more than one SQL statement,
1477+
or is not a DML statment.
1478+
14521479
Example:
14531480

14541481
.. testcode:: sqlite3.cursor

Doc/library/unittest.mock.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ the *new_callable* argument to :func:`patch`.
406406
False
407407

408408
.. versionchanged:: 3.6
409-
Added two keyword only argument to the reset_mock function.
409+
Added two keyword-only arguments to the reset_mock function.
410410

411411
This can be useful where you want to make a series of assertions that
412412
reuse the same object. Note that :meth:`reset_mock` *doesn't* clear the
@@ -416,8 +416,8 @@ the *new_callable* argument to :func:`patch`.
416416
parameter as ``True``. Child mocks and the return value mock
417417
(if any) are reset as well.
418418

419-
.. note:: *return_value*, and :attr:`side_effect` are keyword only
420-
argument.
419+
.. note:: *return_value*, and :attr:`side_effect` are keyword-only
420+
arguments.
421421

422422

423423
.. method:: mock_add_spec(spec, spec_set=False)

Doc/library/urllib.request.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,7 @@ The typical response object is a :class:`urllib.response.addinfourl` instance:
16301630
.. deprecated:: 3.9
16311631
Deprecated in favor of :attr:`~addinfourl.status`.
16321632

1633-
.. method:: getstatus()
1633+
.. method:: getcode()
16341634

16351635
.. deprecated:: 3.9
16361636
Deprecated in favor of :attr:`~addinfourl.status`.

Doc/tools/extensions/pyspecific.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from sphinx.environment import NoUri
2929
from sphinx.locale import _ as sphinx_gettext
3030
from sphinx.util import status_iterator, logging
31+
from sphinx.util.docutils import SphinxDirective
3132
from sphinx.util.nodes import split_explicit_title
3233
from sphinx.writers.text import TextWriter, TextTranslator
3334

@@ -119,7 +120,7 @@ def run(self):
119120

120121
# Support for documenting platform availability
121122

122-
class Availability(Directive):
123+
class Availability(SphinxDirective):
123124

124125
has_content = True
125126
required_arguments = 1
@@ -139,18 +140,19 @@ class Availability(Directive):
139140

140141
def run(self):
141142
availability_ref = ':ref:`Availability <availability>`: '
143+
avail_nodes, avail_msgs = self.state.inline_text(
144+
availability_ref + self.arguments[0],
145+
self.lineno)
142146
pnode = nodes.paragraph(availability_ref + self.arguments[0],
143-
classes=["availability"],)
144-
n, m = self.state.inline_text(availability_ref, self.lineno)
145-
pnode.extend(n + m)
146-
n, m = self.state.inline_text(self.arguments[0], self.lineno)
147-
pnode.extend(n + m)
147+
'', *avail_nodes, *avail_msgs)
148+
self.set_source_info(pnode)
149+
cnode = nodes.container("", pnode, classes=["availability"])
150+
self.set_source_info(cnode)
148151
if self.content:
149-
self.state.nested_parse(self.content, self.content_offset, pnode)
150-
152+
self.state.nested_parse(self.content, self.content_offset, cnode)
151153
self.parse_platforms()
152154

153-
return [pnode]
155+
return [cnode]
154156

155157
def parse_platforms(self):
156158
"""Parse platform information from arguments

Include/internal/pycore_code.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ typedef struct {
9292

9393
#define INLINE_CACHE_ENTRIES_FOR_ITER CACHE_ENTRIES(_PyForIterCache)
9494

95+
typedef struct {
96+
uint16_t counter;
97+
} _PySendCache;
98+
99+
#define INLINE_CACHE_ENTRIES_SEND CACHE_ENTRIES(_PySendCache)
100+
95101
// Borrowed references to common callables:
96102
struct callable_cache {
97103
PyObject *isinstance;
@@ -233,6 +239,7 @@ extern void _Py_Specialize_CompareAndBranch(PyObject *lhs, PyObject *rhs,
233239
extern void _Py_Specialize_UnpackSequence(PyObject *seq, _Py_CODEUNIT *instr,
234240
int oparg);
235241
extern void _Py_Specialize_ForIter(PyObject *iter, _Py_CODEUNIT *instr, int oparg);
242+
extern void _Py_Specialize_Send(PyObject *receiver, _Py_CODEUNIT *instr);
236243

237244
/* Finalizer function for static codeobjects used in deepfreeze.py */
238245
extern void _PyStaticCode_Fini(PyCodeObject *co);

Include/internal/pycore_frame.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,13 @@ enum _frameowner {
4747
};
4848

4949
typedef struct _PyInterpreterFrame {
50-
/* "Specials" section */
50+
PyCodeObject *f_code; /* Strong reference */
51+
struct _PyInterpreterFrame *previous;
5152
PyObject *f_funcobj; /* Strong reference. Only valid if not on C stack */
5253
PyObject *f_globals; /* Borrowed reference. Only valid if not on C stack */
5354
PyObject *f_builtins; /* Borrowed reference. Only valid if not on C stack */
5455
PyObject *f_locals; /* Strong reference, may be NULL. Only valid if not on C stack */
55-
PyCodeObject *f_code; /* Strong reference */
5656
PyFrameObject *frame_obj; /* Strong reference, may be NULL. Only valid if not on C stack */
57-
/* Linkage section */
58-
struct _PyInterpreterFrame *previous;
5957
// NOTE: This is not necessarily the last instruction started in the given
6058
// frame. Rather, it is the code unit *prior to* the *next* instruction. For
6159
// example, it may be an inline CACHE entry, an instruction we just jumped

Include/internal/pycore_opcode.h

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/opcode.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)