Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit21baabd

Browse files
committed
Deploying to gh-pages from @d57b852 🚀
1 parentc7fbb55 commit21baabd

File tree

566 files changed

+1105
-813
lines changed

Some content is hidden

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

566 files changed

+1105
-813
lines changed

‎_sources/c-api/gcsupport.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ provided. In order to use this macro, the :c:member:`~PyTypeObject.tp_traverse`
180180
must name its arguments exactly *visit* and *arg*:
181181
182182
183-
..c:function::voidPy_VISIT(PyObject *o)
183+
..c:macro:: Py_VISIT(o)
184184
185-
If *o* is not ``NULL``, call the *visit* callback, with arguments *o*
185+
Ifthe:c:expr:`PyObject *`*o* is not ``NULL``, call the *visit* callback, with arguments *o*
186186
and *arg*. If *visit* returns a non-zero value, then return it.
187187
Using this macro,:c:member:`~PyTypeObject.tp_traverse` handlers
188188
look like::

‎_sources/c-api/init.rst.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,9 +1190,10 @@ code, or when embedding the Python interpreter:
11901190
.. c:function:: PyThreadState* PyThreadState_Swap(PyThreadState *tstate)
11911191
11921192
Swap the current thread state with the thread state given by the argument
1193-
*tstate*, which may be ``NULL``. The global interpreter lock must be held
1194-
and is not released.
1193+
*tstate*, which may be ``NULL``.
11951194
1195+
The :term:`GIL` does not need to be held, but will be held upon returning
1196+
if *tstate* is non-``NULL``.
11961197
11971198
The following functions use thread-local storage, and are not compatible
11981199
with sub-interpreters:

‎_sources/library/asyncio-dev.rst.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ In addition to enabling the debug mode, consider also:
4646

4747
When the debug mode is enabled:
4848

49-
* asyncio checks for:ref:`coroutines that were not awaited
50-
<asyncio-coroutine-not-scheduled>` and logs them; this mitigates
51-
the "forgotten await" pitfall.
52-
5349
* Many non-threadsafe asyncio APIs (such as:meth:`loop.call_soon` and
5450
:meth:`loop.call_at` methods) raise an exception if they are called
5551
from a wrong thread.

‎_sources/library/asyncio-eventloop.rst.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ Creating Futures and Tasks
355355

356356
..versionadded::3.5.2
357357

358-
..method::loop.create_task(coro, *, name=None, context=None)
358+
..method::loop.create_task(coro, *, name=None, context=None, **kwargs)
359359

360360
Schedule the execution of:ref:`coroutine<coroutine>` *coro*.
361361
Return a:class:`Task` object.
@@ -364,6 +364,11 @@ Creating Futures and Tasks
364364
for interoperability. In this case, the result type is a subclass
365365
of:class:`Task`.
366366

367+
The full function signature is largely the same as that of the
368+
:class:`Task` constructor (or factory) - all of the keyword arguments to
369+
this function are passed through to that interface, except *name*,
370+
or *context* if it is ``None``.
371+
367372
If the *name* argument is provided and not ``None``, it is set as
368373
the name of the task using:meth:`Task.set_name`.
369374

@@ -377,6 +382,13 @@ Creating Futures and Tasks
377382
..versionchanged::3.11
378383
Added the *context* parameter.
379384

385+
..versionchanged::3.13.3
386+
Added ``kwargs`` which passes on arbitrary extra parameters, including ``name`` and ``context``.
387+
388+
..versionchanged::3.13.4
389+
Rolled back the change that passes on *name* and *context* (if it is None),
390+
while still passing on other arbitrary keyword arguments (to avoid breaking backwards compatibility with 3.13.3).
391+
380392
..method::loop.set_task_factory(factory)
381393

382394
Set a task factory that will be used by
@@ -388,6 +400,13 @@ Creating Futures and Tasks
388400
event loop, and *coro* is a coroutine object. The callable
389401
must pass on all *kwargs*, and return a:class:`asyncio.Task`-compatible object.
390402

403+
..versionchanged::3.13.3
404+
Required that all *kwargs* are passed on to:class:`asyncio.Task`.
405+
406+
..versionchanged::3.13.4
407+
*name* is no longer passed to task factories. *context* is no longer passed
408+
to task factories if it is ``None``.
409+
391410
..method::loop.get_task_factory()
392411

393412
Return a task factory or ``None`` if the default one is in use.

‎_sources/library/base64.rst.txt

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,17 @@
1515

1616
This module provides functions for encoding binary data to printable
1717
ASCII characters and decoding such encodings back to binary data.
18-
It provides encoding and decoding functions for the encodings specified in
19-
:rfc:`4648`, which defines the Base16, Base32, and Base64 algorithms,
20-
and for the de-facto standard Ascii85 and Base85 encodings.
21-
22-
The:rfc:`4648` encodings are suitable for encoding binary data so that it can be
23-
safely sent by email, used as parts of URLs, or included as part of an HTTP
24-
POST request. The encoding algorithm is not the same as the
25-
:program:`uuencode` program.
18+
This includes the:ref:`encodings specified in<base64-rfc-4648>`
19+
:rfc:`4648` (Base64, Base32 and Base16)
20+
and the non-standard:ref:`Base85 encodings<base64-base-85>`.
2621

2722
There are two interfaces provided by this module. The modern interface
2823
supports encoding:term:`bytes-like objects <bytes-like object>` to ASCII
2924
:class:`bytes`, and decoding:term:`bytes-like objects <bytes-like object>` or
3025
strings containing ASCII to:class:`bytes`. Both base-64 alphabets
3126
defined in:rfc:`4648` (normal, and URL- and filesystem-safe) are supported.
3227

33-
The legacy interface does not support decoding from strings, but it does
28+
The:ref:`legacy interface<base64-legacy>` does not support decoding from strings, but it does
3429
provide functions for encoding and decoding to and from:term:`file objects
3530
<file object>`. It only supports the Base64 standard alphabet, and it adds
3631
newlines every 76 characters as per:rfc:`2045`. Note that if you are looking
@@ -46,7 +41,15 @@ package instead.
4641
Any:term:`bytes-like objects <bytes-like object>` are now accepted by all
4742
encoding and decoding functions in this module. Ascii85/Base85 support added.
4843

49-
The modern interface provides:
44+
45+
.. _base64-rfc-4648:
46+
47+
RFC 4648 Encodings
48+
------------------
49+
50+
The:rfc:`4648` encodings are suitable for encoding binary data so that it can be
51+
safely sent by email, used as parts of URLs, or included as part of an HTTP
52+
POST request.
5053

5154
..function::b64encode(s, altchars=None)
5255

@@ -181,6 +184,26 @@ The modern interface provides:
181184
incorrectly padded or if there are non-alphabet characters present in the
182185
input.
183186

187+
.. _base64-base-85:
188+
189+
Base85 Encodings
190+
-----------------
191+
192+
Base85 encoding is not formally specified but rather a de facto standard,
193+
thus different systems perform the encoding differently.
194+
195+
The:func:`a85encode` and:func:`b85encode` functions in this module are two implementations of
196+
the de facto standard. You should call the function with the Base85
197+
implementation used by the software you intend to work with.
198+
199+
The two functions present in this module differ in how they handle the following:
200+
201+
* Whether to include enclosing ``<~`` and ``~>`` markers
202+
* Whether to include newline characters
203+
* The set of ASCII characters used for encoding
204+
* Handling of null bytes
205+
206+
Refer to the documentation of the individual functions for more information.
184207

185208
..function::a85encode(b, *, foldspaces=False, wrapcol=0, pad=False, adobe=False)
186209

@@ -262,7 +285,10 @@ The modern interface provides:
262285
..versionadded::3.13
263286

264287

265-
The legacy interface:
288+
.. _base64-legacy:
289+
290+
Legacy Interface
291+
----------------
266292

267293
..function::decode(input, output)
268294

‎_sources/library/http.server.rst.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ provides three different variants:
389389
``'Last-Modified:'`` header with the file's modification time.
390390

391391
Then follows a blank line signifying the end of the headers, and then the
392-
contents of the file are output. If the file's MIME type starts with
393-
``text/`` the file is opened in text mode; otherwise binary mode is used.
392+
contents of the file are output.
394393

395394
For example usage, see the implementation of the ``test`` function
396395
in:source:`Lib/http/server.py`.

‎_sources/library/json.rst.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@ is a lightweight data interchange format inspired by
1818
`JavaScript<https://en.wikipedia.org/wiki/JavaScript>`_ object literal syntax
1919
(although it is not a strict subset of JavaScript [#rfc-errata]_ ).
2020

21+
..note::
22+
The term "object" in the context of JSON processing in Python can be
23+
ambiguous. All values in Python are objects. In JSON, an object refers to
24+
any data wrapped in curly braces, similar to a Python dictionary.
25+
2126
..warning::
2227
Be cautious when parsing JSON data from untrusted sources. A malicious
2328
JSON string may cause the decoder to consume considerable CPU and memory
2429
resources. Limiting the size of data to be parsed is recommended.
2530

26-
:mod:`json` exposes an API familiar to users of the standard library
31+
This module exposes an API familiar to users of the standard library
2732
:mod:`marshal` and:mod:`pickle` modules.
2833

2934
Encoding basic Python object hierarchies::
@@ -60,7 +65,7 @@ Pretty printing::
6065
"6": 7
6166
}
6267

63-
Specializing JSON object encoding::
68+
Customizing JSON object encoding::
6469

6570
>>> import json
6671
>>> def custom_json(obj):
@@ -83,7 +88,7 @@ Decoding JSON::
8388
>>> json.load(io)
8489
['streaming API']
8590

86-
Specializing JSON object decoding::
91+
Customizing JSON object decoding::
8792

8893
>>> import json
8994
>>> def as_complex(dct):
@@ -279,7 +284,7 @@ Basic Usage
279284

280285
:param object_hook:
281286
If set, a function that is called with the result of
282-
any object literal decoded (a:class:`dict`).
287+
anyJSONobject literal decoded (a:class:`dict`).
283288
The return value of this function will be used
284289
instead of the:class:`dict`.
285290
This feature can be used to implement custom decoders,
@@ -289,7 +294,7 @@ Basic Usage
289294

290295
:param object_pairs_hook:
291296
If set, a function that is called with the result of
292-
any object literal decoded with an ordered list of pairs.
297+
anyJSONobject literal decoded with an ordered list of pairs.
293298
The return value of this function will be used
294299
instead of the:class:`dict`.
295300
This feature can be used to implement custom decoders.

‎_sources/library/pathlib.rst.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,9 +1661,12 @@ The following wildcards are supported in patterns for
16611661
``?``
16621662
Matches one non-separator character.
16631663
``[seq]``
1664-
Matches one character in *seq*.
1664+
Matches one character in *seq*, where *seq* is a sequence of characters.
1665+
Range expressions are supported; for example, ``[a-z]`` matches any lowercase ASCII letter.
1666+
Multiple ranges can be combined: ``[a-zA-Z0-9_]`` matches any ASCII letter, digit, or underscore.
1667+
16651668
``[!seq]``
1666-
Matches one character not in *seq*.
1669+
Matches one character not in *seq*, where *seq* follows the same rules as above.
16671670

16681671
For a literal match, wrap the meta-characters in brackets.
16691672
For example, ``"[?]"`` matches the character ``"?"``.

‎_sources/library/re.rst.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -988,8 +988,8 @@ Functions
988988
That way, separator components are always found at the same relative
989989
indices within the result list.
990990

991-
Emptymatchesfor the pattern split the string only when not adjacent
992-
to a previousempty match.
991+
Adjacent emptymatchesare not possible, but an empty match can occur
992+
immediately after a non-empty match.
993993

994994
..code::pycon
995995
@@ -1092,9 +1092,12 @@ Functions
10921092

10931093
The optional argument *count* is the maximum number of pattern occurrences to be
10941094
replaced; *count* must be a non-negative integer. If omitted or zero, all
1095-
occurrences will be replaced. Empty matches for the pattern are replaced only
1096-
when not adjacent to a previous empty match, so ``sub('x*', '-', 'abxd')`` returns
1097-
``'-a-b--d-'``.
1095+
occurrences will be replaced.
1096+
1097+
Adjacent empty matches are not possible, but an empty match can occur
1098+
immediately after a non-empty match.
1099+
As a result, ``sub('x*', '-', 'abxd')`` returns ``'-a-b--d-'``
1100+
instead of ``'-a-b-d-'``.
10981101

10991102
..index::single: \g; in regular expressions
11001103

@@ -1125,8 +1128,7 @@ Functions
11251128
..versionchanged::3.7
11261129
Unknown escapes in *repl* consisting of ``'\'`` and an ASCII letter
11271130
now are errors.
1128-
Empty matches for the pattern are replaced when adjacent to a previous
1129-
non-empty match.
1131+
An empty match can occur immediately after a non-empty match.
11301132

11311133
..versionchanged::3.12
11321134
Group *id* can only contain ASCII digits.

‎_sources/library/stdtypes.rst.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,6 +2133,18 @@ expression support in the :mod:`re` module).
21332133
>>> ' 1 2 3 '.split()
21342134
['1', '2', '3']
21352135

2136+
If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only
2137+
leading runs of consecutive whitespace are considered.
2138+
2139+
For example::
2140+
2141+
>>> "".split(None, 0)
2142+
[]
2143+
>>> " ".split(None, 0)
2144+
[]
2145+
>>> " foo ".split(maxsplit=0)
2146+
['foo ']
2147+
21362148

21372149
..index::
21382150
single: universal newlines; str.splitlines method

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp