[3.9] [doc] Fix erroneous backslashes in signatures and names (GH-23658) (GH-23827)
The issue being resolved is shown in the 3.10 docs (if you select docs for older versions you won't see a visual glitch).
The newer sphinx version that produces the 3.10 docs doesn't treat the backslash to escape things in some situations it previously did..
(cherry picked from commit dcc997cd28
)
Co-authored-by: Andre Delfino <adelfino@gmail.com>
This commit is contained in:
parent
b4b323ce1a
commit
e89993cff4
|
@ -321,7 +321,7 @@ Creating Futures and Tasks
|
||||||
|
|
||||||
.. versionadded:: 3.5.2
|
.. versionadded:: 3.5.2
|
||||||
|
|
||||||
.. method:: loop.create_task(coro, \*, name=None)
|
.. method:: loop.create_task(coro, *, name=None)
|
||||||
|
|
||||||
Schedule the execution of a :ref:`coroutine`.
|
Schedule the execution of a :ref:`coroutine`.
|
||||||
Return a :class:`Task` object.
|
Return a :class:`Task` object.
|
||||||
|
@ -356,7 +356,7 @@ Opening network connections
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. coroutinemethod:: loop.create_connection(protocol_factory, \
|
.. coroutinemethod:: loop.create_connection(protocol_factory, \
|
||||||
host=None, port=None, \*, ssl=None, \
|
host=None, port=None, *, ssl=None, \
|
||||||
family=0, proto=0, flags=0, sock=None, \
|
family=0, proto=0, flags=0, sock=None, \
|
||||||
local_addr=None, server_hostname=None, \
|
local_addr=None, server_hostname=None, \
|
||||||
ssl_handshake_timeout=None, \
|
ssl_handshake_timeout=None, \
|
||||||
|
@ -482,7 +482,7 @@ Opening network connections
|
||||||
that can be used directly in async/await code.
|
that can be used directly in async/await code.
|
||||||
|
|
||||||
.. coroutinemethod:: loop.create_datagram_endpoint(protocol_factory, \
|
.. coroutinemethod:: loop.create_datagram_endpoint(protocol_factory, \
|
||||||
local_addr=None, remote_addr=None, \*, \
|
local_addr=None, remote_addr=None, *, \
|
||||||
family=0, proto=0, flags=0, \
|
family=0, proto=0, flags=0, \
|
||||||
reuse_address=None, reuse_port=None, \
|
reuse_address=None, reuse_port=None, \
|
||||||
allow_broadcast=None, sock=None)
|
allow_broadcast=None, sock=None)
|
||||||
|
@ -559,7 +559,7 @@ Opening network connections
|
||||||
Added support for Windows.
|
Added support for Windows.
|
||||||
|
|
||||||
.. coroutinemethod:: loop.create_unix_connection(protocol_factory, \
|
.. coroutinemethod:: loop.create_unix_connection(protocol_factory, \
|
||||||
path=None, \*, ssl=None, sock=None, \
|
path=None, *, ssl=None, sock=None, \
|
||||||
server_hostname=None, ssl_handshake_timeout=None)
|
server_hostname=None, ssl_handshake_timeout=None)
|
||||||
|
|
||||||
Create a Unix connection.
|
Create a Unix connection.
|
||||||
|
@ -592,7 +592,7 @@ Creating network servers
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. coroutinemethod:: loop.create_server(protocol_factory, \
|
.. coroutinemethod:: loop.create_server(protocol_factory, \
|
||||||
host=None, port=None, \*, \
|
host=None, port=None, *, \
|
||||||
family=socket.AF_UNSPEC, \
|
family=socket.AF_UNSPEC, \
|
||||||
flags=socket.AI_PASSIVE, \
|
flags=socket.AI_PASSIVE, \
|
||||||
sock=None, backlog=100, ssl=None, \
|
sock=None, backlog=100, ssl=None, \
|
||||||
|
@ -683,7 +683,7 @@ Creating network servers
|
||||||
|
|
||||||
|
|
||||||
.. coroutinemethod:: loop.create_unix_server(protocol_factory, path=None, \
|
.. coroutinemethod:: loop.create_unix_server(protocol_factory, path=None, \
|
||||||
\*, sock=None, backlog=100, ssl=None, \
|
*, sock=None, backlog=100, ssl=None, \
|
||||||
ssl_handshake_timeout=None, start_serving=True)
|
ssl_handshake_timeout=None, start_serving=True)
|
||||||
|
|
||||||
Similar to :meth:`loop.create_server` but works with the
|
Similar to :meth:`loop.create_server` but works with the
|
||||||
|
@ -708,7 +708,7 @@ Creating network servers
|
||||||
The *path* parameter can now be a :class:`~pathlib.Path` object.
|
The *path* parameter can now be a :class:`~pathlib.Path` object.
|
||||||
|
|
||||||
.. coroutinemethod:: loop.connect_accepted_socket(protocol_factory, \
|
.. coroutinemethod:: loop.connect_accepted_socket(protocol_factory, \
|
||||||
sock, \*, ssl=None, ssl_handshake_timeout=None)
|
sock, *, ssl=None, ssl_handshake_timeout=None)
|
||||||
|
|
||||||
Wrap an already accepted connection into a transport/protocol pair.
|
Wrap an already accepted connection into a transport/protocol pair.
|
||||||
|
|
||||||
|
@ -773,7 +773,7 @@ TLS Upgrade
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
|
|
||||||
.. coroutinemethod:: loop.start_tls(transport, protocol, \
|
.. coroutinemethod:: loop.start_tls(transport, protocol, \
|
||||||
sslcontext, \*, server_side=False, \
|
sslcontext, *, server_side=False, \
|
||||||
server_hostname=None, ssl_handshake_timeout=None)
|
server_hostname=None, ssl_handshake_timeout=None)
|
||||||
|
|
||||||
Upgrade an existing transport-based connection to TLS.
|
Upgrade an existing transport-based connection to TLS.
|
||||||
|
@ -806,7 +806,7 @@ TLS Upgrade
|
||||||
Watching file descriptors
|
Watching file descriptors
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. method:: loop.add_reader(fd, callback, \*args)
|
.. method:: loop.add_reader(fd, callback, *args)
|
||||||
|
|
||||||
Start monitoring the *fd* file descriptor for read availability and
|
Start monitoring the *fd* file descriptor for read availability and
|
||||||
invoke *callback* with the specified arguments once *fd* is available for
|
invoke *callback* with the specified arguments once *fd* is available for
|
||||||
|
@ -816,7 +816,7 @@ Watching file descriptors
|
||||||
|
|
||||||
Stop monitoring the *fd* file descriptor for read availability.
|
Stop monitoring the *fd* file descriptor for read availability.
|
||||||
|
|
||||||
.. method:: loop.add_writer(fd, callback, \*args)
|
.. method:: loop.add_writer(fd, callback, *args)
|
||||||
|
|
||||||
Start monitoring the *fd* file descriptor for write availability and
|
Start monitoring the *fd* file descriptor for write availability and
|
||||||
invoke *callback* with the specified arguments once *fd* is available for
|
invoke *callback* with the specified arguments once *fd* is available for
|
||||||
|
@ -930,7 +930,7 @@ convenient.
|
||||||
:meth:`loop.create_server` and :func:`start_server`.
|
:meth:`loop.create_server` and :func:`start_server`.
|
||||||
|
|
||||||
.. coroutinemethod:: loop.sock_sendfile(sock, file, offset=0, count=None, \
|
.. coroutinemethod:: loop.sock_sendfile(sock, file, offset=0, count=None, \
|
||||||
\*, fallback=True)
|
*, fallback=True)
|
||||||
|
|
||||||
Send a file using high-performance :mod:`os.sendfile` if possible.
|
Send a file using high-performance :mod:`os.sendfile` if possible.
|
||||||
Return the total number of bytes sent.
|
Return the total number of bytes sent.
|
||||||
|
@ -964,7 +964,7 @@ convenient.
|
||||||
DNS
|
DNS
|
||||||
^^^
|
^^^
|
||||||
|
|
||||||
.. coroutinemethod:: loop.getaddrinfo(host, port, \*, family=0, \
|
.. coroutinemethod:: loop.getaddrinfo(host, port, *, family=0, \
|
||||||
type=0, proto=0, flags=0)
|
type=0, proto=0, flags=0)
|
||||||
|
|
||||||
Asynchronous version of :meth:`socket.getaddrinfo`.
|
Asynchronous version of :meth:`socket.getaddrinfo`.
|
||||||
|
@ -1029,7 +1029,7 @@ Working with pipes
|
||||||
Unix signals
|
Unix signals
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
.. method:: loop.add_signal_handler(signum, callback, \*args)
|
.. method:: loop.add_signal_handler(signum, callback, *args)
|
||||||
|
|
||||||
Set *callback* as the handler for the *signum* signal.
|
Set *callback* as the handler for the *signum* signal.
|
||||||
|
|
||||||
|
@ -1064,7 +1064,7 @@ Unix signals
|
||||||
Executing code in thread or process pools
|
Executing code in thread or process pools
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. awaitablemethod:: loop.run_in_executor(executor, func, \*args)
|
.. awaitablemethod:: loop.run_in_executor(executor, func, *args)
|
||||||
|
|
||||||
Arrange for *func* to be called in the specified executor.
|
Arrange for *func* to be called in the specified executor.
|
||||||
|
|
||||||
|
@ -1234,9 +1234,9 @@ async/await code consider using the high-level
|
||||||
subprocesses. See :ref:`Subprocess Support on Windows
|
subprocesses. See :ref:`Subprocess Support on Windows
|
||||||
<asyncio-windows-subprocess>` for details.
|
<asyncio-windows-subprocess>` for details.
|
||||||
|
|
||||||
.. coroutinemethod:: loop.subprocess_exec(protocol_factory, \*args, \
|
.. coroutinemethod:: loop.subprocess_exec(protocol_factory, *args, \
|
||||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
|
stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
|
||||||
stderr=subprocess.PIPE, \*\*kwargs)
|
stderr=subprocess.PIPE, **kwargs)
|
||||||
|
|
||||||
Create a subprocess from one or more string arguments specified by
|
Create a subprocess from one or more string arguments specified by
|
||||||
*args*.
|
*args*.
|
||||||
|
@ -1316,9 +1316,9 @@ async/await code consider using the high-level
|
||||||
conforms to the :class:`asyncio.SubprocessTransport` base class and
|
conforms to the :class:`asyncio.SubprocessTransport` base class and
|
||||||
*protocol* is an object instantiated by the *protocol_factory*.
|
*protocol* is an object instantiated by the *protocol_factory*.
|
||||||
|
|
||||||
.. coroutinemethod:: loop.subprocess_shell(protocol_factory, cmd, \*, \
|
.. coroutinemethod:: loop.subprocess_shell(protocol_factory, cmd, *, \
|
||||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
|
stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
|
||||||
stderr=subprocess.PIPE, \*\*kwargs)
|
stderr=subprocess.PIPE, **kwargs)
|
||||||
|
|
||||||
Create a subprocess from *cmd*, which can be a :class:`str` or a
|
Create a subprocess from *cmd*, which can be a :class:`str` or a
|
||||||
:class:`bytes` string encoded to the
|
:class:`bytes` string encoded to the
|
||||||
|
|
|
@ -31,7 +31,7 @@ Future Functions
|
||||||
.. versionadded:: 3.5
|
.. versionadded:: 3.5
|
||||||
|
|
||||||
|
|
||||||
.. function:: ensure_future(obj, \*, loop=None)
|
.. function:: ensure_future(obj, *, loop=None)
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ Future Functions
|
||||||
The function accepts any :term:`awaitable` object.
|
The function accepts any :term:`awaitable` object.
|
||||||
|
|
||||||
|
|
||||||
.. function:: wrap_future(future, \*, loop=None)
|
.. function:: wrap_future(future, *, loop=None)
|
||||||
|
|
||||||
Wrap a :class:`concurrent.futures.Future` object in a
|
Wrap a :class:`concurrent.futures.Future` object in a
|
||||||
:class:`asyncio.Future` object.
|
:class:`asyncio.Future` object.
|
||||||
|
@ -67,7 +67,7 @@ Future Functions
|
||||||
Future Object
|
Future Object
|
||||||
=============
|
=============
|
||||||
|
|
||||||
.. class:: Future(\*, loop=None)
|
.. class:: Future(*, loop=None)
|
||||||
|
|
||||||
A Future represents an eventual result of an asynchronous
|
A Future represents an eventual result of an asynchronous
|
||||||
operation. Not thread-safe.
|
operation. Not thread-safe.
|
||||||
|
|
|
@ -159,7 +159,7 @@ implementation used by the asyncio event loop:
|
||||||
|
|
||||||
.. class:: AbstractChildWatcher
|
.. class:: AbstractChildWatcher
|
||||||
|
|
||||||
.. method:: add_child_handler(pid, callback, \*args)
|
.. method:: add_child_handler(pid, callback, *args)
|
||||||
|
|
||||||
Register a new child handler.
|
Register a new child handler.
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ The following top-level asyncio functions can be used to create
|
||||||
and work with streams:
|
and work with streams:
|
||||||
|
|
||||||
|
|
||||||
.. coroutinefunction:: open_connection(host=None, port=None, \*, \
|
.. coroutinefunction:: open_connection(host=None, port=None, *, \
|
||||||
loop=None, limit=None, ssl=None, family=0, \
|
loop=None, limit=None, ssl=None, family=0, \
|
||||||
proto=0, flags=0, sock=None, local_addr=None, \
|
proto=0, flags=0, sock=None, local_addr=None, \
|
||||||
server_hostname=None, ssl_handshake_timeout=None)
|
server_hostname=None, ssl_handshake_timeout=None)
|
||||||
|
@ -74,7 +74,7 @@ and work with streams:
|
||||||
The *ssl_handshake_timeout* parameter.
|
The *ssl_handshake_timeout* parameter.
|
||||||
|
|
||||||
.. coroutinefunction:: start_server(client_connected_cb, host=None, \
|
.. coroutinefunction:: start_server(client_connected_cb, host=None, \
|
||||||
port=None, \*, loop=None, limit=None, \
|
port=None, *, loop=None, limit=None, \
|
||||||
family=socket.AF_UNSPEC, \
|
family=socket.AF_UNSPEC, \
|
||||||
flags=socket.AI_PASSIVE, sock=None, \
|
flags=socket.AI_PASSIVE, sock=None, \
|
||||||
backlog=100, ssl=None, reuse_address=None, \
|
backlog=100, ssl=None, reuse_address=None, \
|
||||||
|
@ -109,7 +109,7 @@ and work with streams:
|
||||||
|
|
||||||
.. rubric:: Unix Sockets
|
.. rubric:: Unix Sockets
|
||||||
|
|
||||||
.. coroutinefunction:: open_unix_connection(path=None, \*, loop=None, \
|
.. coroutinefunction:: open_unix_connection(path=None, *, loop=None, \
|
||||||
limit=None, ssl=None, sock=None, \
|
limit=None, ssl=None, sock=None, \
|
||||||
server_hostname=None, ssl_handshake_timeout=None)
|
server_hostname=None, ssl_handshake_timeout=None)
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ and work with streams:
|
||||||
|
|
||||||
|
|
||||||
.. coroutinefunction:: start_unix_server(client_connected_cb, path=None, \
|
.. coroutinefunction:: start_unix_server(client_connected_cb, path=None, \
|
||||||
\*, loop=None, limit=None, sock=None, \
|
*, loop=None, limit=None, sock=None, \
|
||||||
backlog=100, ssl=None, ssl_handshake_timeout=None, \
|
backlog=100, ssl=None, ssl_handshake_timeout=None, \
|
||||||
start_serving=True)
|
start_serving=True)
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ StreamReader
|
||||||
can be read. Use the :attr:`IncompleteReadError.partial`
|
can be read. Use the :attr:`IncompleteReadError.partial`
|
||||||
attribute to get the partially read data.
|
attribute to get the partially read data.
|
||||||
|
|
||||||
.. coroutinemethod:: readuntil(separator=b'\\n')
|
.. coroutinemethod:: readuntil(separator=b'\n')
|
||||||
|
|
||||||
Read data from the stream until *separator* is found.
|
Read data from the stream until *separator* is found.
|
||||||
|
|
||||||
|
|
|
@ -61,9 +61,9 @@ See also the `Examples`_ subsection.
|
||||||
Creating Subprocesses
|
Creating Subprocesses
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
.. coroutinefunction:: create_subprocess_exec(program, \*args, stdin=None, \
|
.. coroutinefunction:: create_subprocess_exec(program, *args, stdin=None, \
|
||||||
stdout=None, stderr=None, loop=None, \
|
stdout=None, stderr=None, loop=None, \
|
||||||
limit=None, \*\*kwds)
|
limit=None, **kwds)
|
||||||
|
|
||||||
Create a subprocess.
|
Create a subprocess.
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ Creating Subprocesses
|
||||||
|
|
||||||
.. coroutinefunction:: create_subprocess_shell(cmd, stdin=None, \
|
.. coroutinefunction:: create_subprocess_shell(cmd, stdin=None, \
|
||||||
stdout=None, stderr=None, loop=None, \
|
stdout=None, stderr=None, loop=None, \
|
||||||
limit=None, \*\*kwds)
|
limit=None, **kwds)
|
||||||
|
|
||||||
Run the *cmd* shell command.
|
Run the *cmd* shell command.
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ is :meth:`loop.run_in_executor`.
|
||||||
Running an asyncio Program
|
Running an asyncio Program
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
.. function:: run(coro, \*, debug=False)
|
.. function:: run(coro, *, debug=False)
|
||||||
|
|
||||||
Execute the :term:`coroutine` *coro* and return the result.
|
Execute the :term:`coroutine` *coro* and return the result.
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ Running an asyncio Program
|
||||||
Creating Tasks
|
Creating Tasks
|
||||||
==============
|
==============
|
||||||
|
|
||||||
.. function:: create_task(coro, \*, name=None)
|
.. function:: create_task(coro, *, name=None)
|
||||||
|
|
||||||
Wrap the *coro* :ref:`coroutine <coroutine>` into a :class:`Task`
|
Wrap the *coro* :ref:`coroutine <coroutine>` into a :class:`Task`
|
||||||
and schedule its execution. Return the Task object.
|
and schedule its execution. Return the Task object.
|
||||||
|
@ -283,7 +283,7 @@ Creating Tasks
|
||||||
Sleeping
|
Sleeping
|
||||||
========
|
========
|
||||||
|
|
||||||
.. coroutinefunction:: sleep(delay, result=None, \*, loop=None)
|
.. coroutinefunction:: sleep(delay, result=None, *, loop=None)
|
||||||
|
|
||||||
Block for *delay* seconds.
|
Block for *delay* seconds.
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ Sleeping
|
||||||
Running Tasks Concurrently
|
Running Tasks Concurrently
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
.. awaitablefunction:: gather(\*aws, loop=None, return_exceptions=False)
|
.. awaitablefunction:: gather(*aws, loop=None, return_exceptions=False)
|
||||||
|
|
||||||
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
|
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
|
||||||
sequence *concurrently*.
|
sequence *concurrently*.
|
||||||
|
@ -403,7 +403,7 @@ Running Tasks Concurrently
|
||||||
Shielding From Cancellation
|
Shielding From Cancellation
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
.. awaitablefunction:: shield(aw, \*, loop=None)
|
.. awaitablefunction:: shield(aw, *, loop=None)
|
||||||
|
|
||||||
Protect an :ref:`awaitable object <asyncio-awaitables>`
|
Protect an :ref:`awaitable object <asyncio-awaitables>`
|
||||||
from being :meth:`cancelled <Task.cancel>`.
|
from being :meth:`cancelled <Task.cancel>`.
|
||||||
|
@ -443,7 +443,7 @@ Shielding From Cancellation
|
||||||
Timeouts
|
Timeouts
|
||||||
========
|
========
|
||||||
|
|
||||||
.. coroutinefunction:: wait_for(aw, timeout, \*, loop=None)
|
.. coroutinefunction:: wait_for(aw, timeout, *, loop=None)
|
||||||
|
|
||||||
Wait for the *aw* :ref:`awaitable <asyncio-awaitables>`
|
Wait for the *aw* :ref:`awaitable <asyncio-awaitables>`
|
||||||
to complete with a timeout.
|
to complete with a timeout.
|
||||||
|
@ -500,7 +500,7 @@ Timeouts
|
||||||
Waiting Primitives
|
Waiting Primitives
|
||||||
==================
|
==================
|
||||||
|
|
||||||
.. coroutinefunction:: wait(aws, \*, loop=None, timeout=None,\
|
.. coroutinefunction:: wait(aws, *, loop=None, timeout=None,\
|
||||||
return_when=ALL_COMPLETED)
|
return_when=ALL_COMPLETED)
|
||||||
|
|
||||||
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
|
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
|
||||||
|
@ -590,7 +590,7 @@ Waiting Primitives
|
||||||
deprecated.
|
deprecated.
|
||||||
|
|
||||||
|
|
||||||
.. function:: as_completed(aws, \*, loop=None, timeout=None)
|
.. function:: as_completed(aws, *, loop=None, timeout=None)
|
||||||
|
|
||||||
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
|
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
|
||||||
iterable concurrently. Return an iterator of coroutines.
|
iterable concurrently. Return an iterator of coroutines.
|
||||||
|
@ -613,7 +613,7 @@ Waiting Primitives
|
||||||
Running in Threads
|
Running in Threads
|
||||||
==================
|
==================
|
||||||
|
|
||||||
.. coroutinefunction:: to_thread(func, /, \*args, \*\*kwargs)
|
.. coroutinefunction:: to_thread(func, /, *args, **kwargs)
|
||||||
|
|
||||||
Asynchronously run function *func* in a separate thread.
|
Asynchronously run function *func* in a separate thread.
|
||||||
|
|
||||||
|
@ -743,7 +743,7 @@ Introspection
|
||||||
Task Object
|
Task Object
|
||||||
===========
|
===========
|
||||||
|
|
||||||
.. class:: Task(coro, \*, loop=None, name=None)
|
.. class:: Task(coro, *, loop=None, name=None)
|
||||||
|
|
||||||
A :class:`Future-like <Future>` object that runs a Python
|
A :class:`Future-like <Future>` object that runs a Python
|
||||||
:ref:`coroutine <coroutine>`. Not thread-safe.
|
:ref:`coroutine <coroutine>`. Not thread-safe.
|
||||||
|
@ -909,7 +909,7 @@ Task Object
|
||||||
See the documentation of :meth:`Future.remove_done_callback`
|
See the documentation of :meth:`Future.remove_done_callback`
|
||||||
for more details.
|
for more details.
|
||||||
|
|
||||||
.. method:: get_stack(\*, limit=None)
|
.. method:: get_stack(*, limit=None)
|
||||||
|
|
||||||
Return the list of stack frames for this Task.
|
Return the list of stack frames for this Task.
|
||||||
|
|
||||||
|
@ -930,7 +930,7 @@ Task Object
|
||||||
stack are returned, but the oldest frames of a traceback are
|
stack are returned, but the oldest frames of a traceback are
|
||||||
returned. (This matches the behavior of the traceback module.)
|
returned. (This matches the behavior of the traceback module.)
|
||||||
|
|
||||||
.. method:: print_stack(\*, limit=None, file=None)
|
.. method:: print_stack(*, limit=None, file=None)
|
||||||
|
|
||||||
Print the stack or traceback for this Task.
|
Print the stack or traceback for this Task.
|
||||||
|
|
||||||
|
|
|
@ -178,7 +178,7 @@ The modern interface provides:
|
||||||
.. versionadded:: 3.4
|
.. versionadded:: 3.4
|
||||||
|
|
||||||
|
|
||||||
.. function:: a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \\t\\n\\r\\v')
|
.. function:: a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v')
|
||||||
|
|
||||||
Decode the Ascii85 encoded :term:`bytes-like object` or ASCII string *b* and
|
Decode the Ascii85 encoded :term:`bytes-like object` or ASCII string *b* and
|
||||||
return the decoded :class:`bytes`.
|
return the decoded :class:`bytes`.
|
||||||
|
|
|
@ -148,7 +148,7 @@ runtime.
|
||||||
Public functions
|
Public functions
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
.. function:: compile_dir(dir, maxlevels=sys.getrecursionlimit(), ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1, workers=1, invalidation_mode=None, \*, stripdir=None, prependdir=None, limit_sl_dest=None, hardlink_dupes=False)
|
.. function:: compile_dir(dir, maxlevels=sys.getrecursionlimit(), ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1, workers=1, invalidation_mode=None, *, stripdir=None, prependdir=None, limit_sl_dest=None, hardlink_dupes=False)
|
||||||
|
|
||||||
Recursively descend the directory tree named by *dir*, compiling all :file:`.py`
|
Recursively descend the directory tree named by *dir*, compiling all :file:`.py`
|
||||||
files along the way. Return a true value if all the files compiled successfully,
|
files along the way. Return a true value if all the files compiled successfully,
|
||||||
|
@ -231,7 +231,7 @@ Public functions
|
||||||
Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* arguments.
|
Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* arguments.
|
||||||
Default value of *maxlevels* was changed from ``10`` to ``sys.getrecursionlimit()``
|
Default value of *maxlevels* was changed from ``10`` to ``sys.getrecursionlimit()``
|
||||||
|
|
||||||
.. function:: compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1, invalidation_mode=None, \*, stripdir=None, prependdir=None, limit_sl_dest=None, hardlink_dupes=False)
|
.. function:: compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1, invalidation_mode=None, *, stripdir=None, prependdir=None, limit_sl_dest=None, hardlink_dupes=False)
|
||||||
|
|
||||||
Compile the file with path *fullname*. Return a true value if the file
|
Compile the file with path *fullname*. Return a true value if the file
|
||||||
compiled successfully, and a false value otherwise.
|
compiled successfully, and a false value otherwise.
|
||||||
|
|
|
@ -67,7 +67,7 @@ Executor Objects
|
||||||
.. versionchanged:: 3.5
|
.. versionchanged:: 3.5
|
||||||
Added the *chunksize* argument.
|
Added the *chunksize* argument.
|
||||||
|
|
||||||
.. method:: shutdown(wait=True, \*, cancel_futures=False)
|
.. method:: shutdown(wait=True, *, cancel_futures=False)
|
||||||
|
|
||||||
Signal the executor that it should free any resources that it is using
|
Signal the executor that it should free any resources that it is using
|
||||||
when the currently pending futures are done executing. Calls to
|
when the currently pending futures are done executing. Calls to
|
||||||
|
|
|
@ -26,7 +26,7 @@ See also :pep:`567` for additional details.
|
||||||
Context Variables
|
Context Variables
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
.. class:: ContextVar(name, [\*, default])
|
.. class:: ContextVar(name, [*, default])
|
||||||
|
|
||||||
This class is used to declare a new Context Variable, e.g.::
|
This class is used to declare a new Context Variable, e.g.::
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ Manual Context Management
|
||||||
|
|
||||||
Context implements the :class:`collections.abc.Mapping` interface.
|
Context implements the :class:`collections.abc.Mapping` interface.
|
||||||
|
|
||||||
.. method:: run(callable, \*args, \*\*kwargs)
|
.. method:: run(callable, *args, **kwargs)
|
||||||
|
|
||||||
Execute ``callable(*args, **kwargs)`` code in the context object
|
Execute ``callable(*args, **kwargs)`` code in the context object
|
||||||
the *run* method is called on. Return the result of the execution
|
the *run* method is called on. Return the result of the execution
|
||||||
|
|
|
@ -2508,7 +2508,7 @@ other data types containing pointer type fields.
|
||||||
Arrays and pointers
|
Arrays and pointers
|
||||||
^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. class:: Array(\*args)
|
.. class:: Array(*args)
|
||||||
|
|
||||||
Abstract base class for arrays.
|
Abstract base class for arrays.
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
|
||||||
contains a good example of its use.
|
contains a good example of its use.
|
||||||
|
|
||||||
|
|
||||||
.. function:: context_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\\n')
|
.. function:: context_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n')
|
||||||
|
|
||||||
Compare *a* and *b* (lists of strings); return a delta (a :term:`generator`
|
Compare *a* and *b* (lists of strings); return a delta (a :term:`generator`
|
||||||
generating the delta lines) in context diff format.
|
generating the delta lines) in context diff format.
|
||||||
|
@ -279,7 +279,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
|
||||||
emu
|
emu
|
||||||
|
|
||||||
|
|
||||||
.. function:: unified_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\\n')
|
.. function:: unified_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n')
|
||||||
|
|
||||||
Compare *a* and *b* (lists of strings); return a delta (a :term:`generator`
|
Compare *a* and *b* (lists of strings); return a delta (a :term:`generator`
|
||||||
generating the delta lines) in unified diff format.
|
generating the delta lines) in unified diff format.
|
||||||
|
@ -321,7 +321,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
|
||||||
|
|
||||||
See :ref:`difflib-interface` for a more detailed example.
|
See :ref:`difflib-interface` for a more detailed example.
|
||||||
|
|
||||||
.. function:: diff_bytes(dfunc, a, b, fromfile=b'', tofile=b'', fromfiledate=b'', tofiledate=b'', n=3, lineterm=b'\\n')
|
.. function:: diff_bytes(dfunc, a, b, fromfile=b'', tofile=b'', fromfiledate=b'', tofiledate=b'', n=3, lineterm=b'\n')
|
||||||
|
|
||||||
Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a
|
Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a
|
||||||
sequence of delta lines (also bytes) in the format returned by *dfunc*.
|
sequence of delta lines (also bytes) in the format returned by *dfunc*.
|
||||||
|
|
|
@ -116,7 +116,7 @@ Here is the :class:`Header` class description:
|
||||||
if *s* is a byte string.
|
if *s* is a byte string.
|
||||||
|
|
||||||
|
|
||||||
.. method:: encode(splitchars=';, \\t', maxlinelen=None, linesep='\\n')
|
.. method:: encode(splitchars=';, \t', maxlinelen=None, linesep='\n')
|
||||||
|
|
||||||
Encode a message header into an RFC-compliant format, possibly wrapping
|
Encode a message header into an RFC-compliant format, possibly wrapping
|
||||||
long lines and encapsulating non-ASCII parts in base64 or quoted-printable
|
long lines and encapsulating non-ASCII parts in base64 or quoted-printable
|
||||||
|
|
|
@ -210,7 +210,7 @@ added matters. To illustrate::
|
||||||
:meth:`register_defect` method.
|
:meth:`register_defect` method.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: mangle_from\_
|
.. attribute:: mangle_from_
|
||||||
|
|
||||||
If :const:`True`, lines starting with *"From "* in the body are
|
If :const:`True`, lines starting with *"From "* in the body are
|
||||||
escaped by putting a ``>`` in front of them. This parameter is used when
|
escaped by putting a ``>`` in front of them. This parameter is used when
|
||||||
|
|
|
@ -1316,7 +1316,7 @@ are always available. They are listed here in alphabetical order.
|
||||||
supported.
|
supported.
|
||||||
|
|
||||||
|
|
||||||
.. function:: print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False)
|
.. function:: print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
|
||||||
|
|
||||||
Print *objects* to the text stream *file*, separated by *sep* and followed
|
Print *objects* to the text stream *file*, separated by *sep* and followed
|
||||||
by *end*. *sep*, *end*, *file* and *flush*, if present, must be given as keyword
|
by *end*. *sep*, *end*, *file* and *flush*, if present, must be given as keyword
|
||||||
|
|
|
@ -93,7 +93,7 @@ Cookie Objects
|
||||||
:meth:`value_decode` are inverses on the range of *value_decode*.
|
:meth:`value_decode` are inverses on the range of *value_decode*.
|
||||||
|
|
||||||
|
|
||||||
.. method:: BaseCookie.output(attrs=None, header='Set-Cookie:', sep='\\r\\n')
|
.. method:: BaseCookie.output(attrs=None, header='Set-Cookie:', sep='\r\n')
|
||||||
|
|
||||||
Return a string representation suitable to be sent as HTTP headers. *attrs* and
|
Return a string representation suitable to be sent as HTTP headers. *attrs* and
|
||||||
*header* are sent to each :class:`Morsel`'s :meth:`output` method. *sep* is used
|
*header* are sent to each :class:`Morsel`'s :meth:`output` method. *sep* is used
|
||||||
|
|
|
@ -1135,7 +1135,7 @@ find and load modules.
|
||||||
directory for ``''`` (i.e. the empty string).
|
directory for ``''`` (i.e. the empty string).
|
||||||
|
|
||||||
|
|
||||||
.. class:: FileFinder(path, \*loader_details)
|
.. class:: FileFinder(path, *loader_details)
|
||||||
|
|
||||||
A concrete implementation of :class:`importlib.abc.PathEntryFinder` which
|
A concrete implementation of :class:`importlib.abc.PathEntryFinder` which
|
||||||
caches results from the file system.
|
caches results from the file system.
|
||||||
|
@ -1178,7 +1178,7 @@ find and load modules.
|
||||||
|
|
||||||
Clear out the internal cache.
|
Clear out the internal cache.
|
||||||
|
|
||||||
.. classmethod:: path_hook(\*loader_details)
|
.. classmethod:: path_hook(*loader_details)
|
||||||
|
|
||||||
A class method which returns a closure for use on :attr:`sys.path_hooks`.
|
A class method which returns a closure for use on :attr:`sys.path_hooks`.
|
||||||
An instance of :class:`FileFinder` is returned by the closure using the
|
An instance of :class:`FileFinder` is returned by the closure using the
|
||||||
|
|
|
@ -556,7 +556,7 @@ The Signature object represents the call signature of a callable object and its
|
||||||
return annotation. To retrieve a Signature object, use the :func:`signature`
|
return annotation. To retrieve a Signature object, use the :func:`signature`
|
||||||
function.
|
function.
|
||||||
|
|
||||||
.. function:: signature(callable, \*, follow_wrapped=True)
|
.. function:: signature(callable, *, follow_wrapped=True)
|
||||||
|
|
||||||
Return a :class:`Signature` object for the given ``callable``::
|
Return a :class:`Signature` object for the given ``callable``::
|
||||||
|
|
||||||
|
@ -597,7 +597,7 @@ function.
|
||||||
C provide no metadata about their arguments.
|
C provide no metadata about their arguments.
|
||||||
|
|
||||||
|
|
||||||
.. class:: Signature(parameters=None, \*, return_annotation=Signature.empty)
|
.. class:: Signature(parameters=None, *, return_annotation=Signature.empty)
|
||||||
|
|
||||||
A Signature object represents the call signature of a function and its return
|
A Signature object represents the call signature of a function and its return
|
||||||
annotation. For each parameter accepted by the function it stores a
|
annotation. For each parameter accepted by the function it stores a
|
||||||
|
@ -668,7 +668,7 @@ function.
|
||||||
>>> str(new_sig)
|
>>> str(new_sig)
|
||||||
"(a, b) -> 'new return anno'"
|
"(a, b) -> 'new return anno'"
|
||||||
|
|
||||||
.. classmethod:: Signature.from_callable(obj, \*, follow_wrapped=True)
|
.. classmethod:: Signature.from_callable(obj, *, follow_wrapped=True)
|
||||||
|
|
||||||
Return a :class:`Signature` (or its subclass) object for a given callable
|
Return a :class:`Signature` (or its subclass) object for a given callable
|
||||||
``obj``. Pass ``follow_wrapped=False`` to get a signature of ``obj``
|
``obj``. Pass ``follow_wrapped=False`` to get a signature of ``obj``
|
||||||
|
@ -684,7 +684,7 @@ function.
|
||||||
.. versionadded:: 3.5
|
.. versionadded:: 3.5
|
||||||
|
|
||||||
|
|
||||||
.. class:: Parameter(name, kind, \*, default=Parameter.empty, annotation=Parameter.empty)
|
.. class:: Parameter(name, kind, *, default=Parameter.empty, annotation=Parameter.empty)
|
||||||
|
|
||||||
Parameter objects are *immutable*. Instead of modifying a Parameter object,
|
Parameter objects are *immutable*. Instead of modifying a Parameter object,
|
||||||
you can use :meth:`Parameter.replace` to create a modified copy.
|
you can use :meth:`Parameter.replace` to create a modified copy.
|
||||||
|
|
|
@ -964,7 +964,7 @@ Text I/O
|
||||||
.. versionadded:: 3.7
|
.. versionadded:: 3.7
|
||||||
|
|
||||||
|
|
||||||
.. class:: StringIO(initial_value='', newline='\\n')
|
.. class:: StringIO(initial_value='', newline='\n')
|
||||||
|
|
||||||
A text stream using an in-memory text buffer. It inherits
|
A text stream using an in-memory text buffer. It inherits
|
||||||
:class:`TextIOBase`.
|
:class:`TextIOBase`.
|
||||||
|
|
|
@ -33,7 +33,7 @@ from multiple threads, it is necessary to protect it with a lock.
|
||||||
Reading and writing compressed files
|
Reading and writing compressed files
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
.. function:: open(filename, mode="rb", \*, format=None, check=-1, preset=None, filters=None, encoding=None, errors=None, newline=None)
|
.. function:: open(filename, mode="rb", *, format=None, check=-1, preset=None, filters=None, encoding=None, errors=None, newline=None)
|
||||||
|
|
||||||
Open an LZMA-compressed file in binary or text mode, returning a :term:`file
|
Open an LZMA-compressed file in binary or text mode, returning a :term:`file
|
||||||
object`.
|
object`.
|
||||||
|
@ -69,7 +69,7 @@ Reading and writing compressed files
|
||||||
Accepts a :term:`path-like object`.
|
Accepts a :term:`path-like object`.
|
||||||
|
|
||||||
|
|
||||||
.. class:: LZMAFile(filename=None, mode="r", \*, format=None, check=-1, preset=None, filters=None)
|
.. class:: LZMAFile(filename=None, mode="r", *, format=None, check=-1, preset=None, filters=None)
|
||||||
|
|
||||||
Open an LZMA-compressed file in binary mode.
|
Open an LZMA-compressed file in binary mode.
|
||||||
|
|
||||||
|
|
|
@ -1869,7 +1869,7 @@ features:
|
||||||
Accepts a :term:`path-like object`.
|
Accepts a :term:`path-like object`.
|
||||||
|
|
||||||
|
|
||||||
.. function:: lstat(path, \*, dir_fd=None)
|
.. function:: lstat(path, *, dir_fd=None)
|
||||||
|
|
||||||
Perform the equivalent of an :c:func:`lstat` system call on the given path.
|
Perform the equivalent of an :c:func:`lstat` system call on the given path.
|
||||||
Similar to :func:`~os.stat`, but does not follow symbolic links. Return a
|
Similar to :func:`~os.stat`, but does not follow symbolic links. Return a
|
||||||
|
@ -2376,7 +2376,7 @@ features:
|
||||||
On the first, uncached call, a system call is required on Windows but
|
On the first, uncached call, a system call is required on Windows but
|
||||||
not on Unix.
|
not on Unix.
|
||||||
|
|
||||||
.. method:: is_dir(\*, follow_symlinks=True)
|
.. method:: is_dir(*, follow_symlinks=True)
|
||||||
|
|
||||||
Return ``True`` if this entry is a directory or a symbolic link pointing
|
Return ``True`` if this entry is a directory or a symbolic link pointing
|
||||||
to a directory; return ``False`` if the entry is or points to any other
|
to a directory; return ``False`` if the entry is or points to any other
|
||||||
|
@ -2400,7 +2400,7 @@ features:
|
||||||
This method can raise :exc:`OSError`, such as :exc:`PermissionError`,
|
This method can raise :exc:`OSError`, such as :exc:`PermissionError`,
|
||||||
but :exc:`FileNotFoundError` is caught and not raised.
|
but :exc:`FileNotFoundError` is caught and not raised.
|
||||||
|
|
||||||
.. method:: is_file(\*, follow_symlinks=True)
|
.. method:: is_file(*, follow_symlinks=True)
|
||||||
|
|
||||||
Return ``True`` if this entry is a file or a symbolic link pointing to a
|
Return ``True`` if this entry is a file or a symbolic link pointing to a
|
||||||
file; return ``False`` if the entry is or points to a directory or other
|
file; return ``False`` if the entry is or points to a directory or other
|
||||||
|
@ -2430,7 +2430,7 @@ features:
|
||||||
This method can raise :exc:`OSError`, such as :exc:`PermissionError`,
|
This method can raise :exc:`OSError`, such as :exc:`PermissionError`,
|
||||||
but :exc:`FileNotFoundError` is caught and not raised.
|
but :exc:`FileNotFoundError` is caught and not raised.
|
||||||
|
|
||||||
.. method:: stat(\*, follow_symlinks=True)
|
.. method:: stat(*, follow_symlinks=True)
|
||||||
|
|
||||||
Return a :class:`stat_result` object for this entry. This method
|
Return a :class:`stat_result` object for this entry. This method
|
||||||
follows symbolic links by default; to stat a symbolic link add the
|
follows symbolic links by default; to stat a symbolic link add the
|
||||||
|
@ -2462,7 +2462,7 @@ features:
|
||||||
for :class:`bytes` paths on Windows.
|
for :class:`bytes` paths on Windows.
|
||||||
|
|
||||||
|
|
||||||
.. function:: stat(path, \*, dir_fd=None, follow_symlinks=True)
|
.. function:: stat(path, *, dir_fd=None, follow_symlinks=True)
|
||||||
|
|
||||||
Get the status of a file or a file descriptor. Perform the equivalent of a
|
Get the status of a file or a file descriptor. Perform the equivalent of a
|
||||||
:c:func:`stat` system call on the given path. *path* may be specified as
|
:c:func:`stat` system call on the given path. *path* may be specified as
|
||||||
|
|
|
@ -213,7 +213,7 @@ The :mod:`pickle` module provides the following constants:
|
||||||
The :mod:`pickle` module provides the following functions to make the pickling
|
The :mod:`pickle` module provides the following functions to make the pickling
|
||||||
process more convenient:
|
process more convenient:
|
||||||
|
|
||||||
.. function:: dump(obj, file, protocol=None, \*, fix_imports=True, buffer_callback=None)
|
.. function:: dump(obj, file, protocol=None, *, fix_imports=True, buffer_callback=None)
|
||||||
|
|
||||||
Write the pickled representation of the object *obj* to the open
|
Write the pickled representation of the object *obj* to the open
|
||||||
:term:`file object` *file*. This is equivalent to
|
:term:`file object` *file*. This is equivalent to
|
||||||
|
@ -225,7 +225,7 @@ process more convenient:
|
||||||
.. versionchanged:: 3.8
|
.. versionchanged:: 3.8
|
||||||
The *buffer_callback* argument was added.
|
The *buffer_callback* argument was added.
|
||||||
|
|
||||||
.. function:: dumps(obj, protocol=None, \*, fix_imports=True, buffer_callback=None)
|
.. function:: dumps(obj, protocol=None, *, fix_imports=True, buffer_callback=None)
|
||||||
|
|
||||||
Return the pickled representation of the object *obj* as a :class:`bytes` object,
|
Return the pickled representation of the object *obj* as a :class:`bytes` object,
|
||||||
instead of writing it to a file.
|
instead of writing it to a file.
|
||||||
|
@ -236,7 +236,7 @@ process more convenient:
|
||||||
.. versionchanged:: 3.8
|
.. versionchanged:: 3.8
|
||||||
The *buffer_callback* argument was added.
|
The *buffer_callback* argument was added.
|
||||||
|
|
||||||
.. function:: load(file, \*, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
|
.. function:: load(file, *, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
|
||||||
|
|
||||||
Read the pickled representation of an object from the open :term:`file object`
|
Read the pickled representation of an object from the open :term:`file object`
|
||||||
*file* and return the reconstituted object hierarchy specified therein.
|
*file* and return the reconstituted object hierarchy specified therein.
|
||||||
|
@ -252,7 +252,7 @@ process more convenient:
|
||||||
.. versionchanged:: 3.8
|
.. versionchanged:: 3.8
|
||||||
The *buffers* argument was added.
|
The *buffers* argument was added.
|
||||||
|
|
||||||
.. function:: loads(data, /, \*, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
|
.. function:: loads(data, /, *, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
|
||||||
|
|
||||||
Return the reconstituted object hierarchy of the pickled representation
|
Return the reconstituted object hierarchy of the pickled representation
|
||||||
*data* of an object. *data* must be a :term:`bytes-like object`.
|
*data* of an object. *data* must be a :term:`bytes-like object`.
|
||||||
|
@ -296,7 +296,7 @@ The :mod:`pickle` module defines three exceptions:
|
||||||
The :mod:`pickle` module exports three classes, :class:`Pickler`,
|
The :mod:`pickle` module exports three classes, :class:`Pickler`,
|
||||||
:class:`Unpickler` and :class:`PickleBuffer`:
|
:class:`Unpickler` and :class:`PickleBuffer`:
|
||||||
|
|
||||||
.. class:: Pickler(file, protocol=None, \*, fix_imports=True, buffer_callback=None)
|
.. class:: Pickler(file, protocol=None, *, fix_imports=True, buffer_callback=None)
|
||||||
|
|
||||||
This takes a binary file for writing a pickle data stream.
|
This takes a binary file for writing a pickle data stream.
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,
|
||||||
Use :func:`pickletools.optimize` if you need more compact pickles.
|
Use :func:`pickletools.optimize` if you need more compact pickles.
|
||||||
|
|
||||||
|
|
||||||
.. class:: Unpickler(file, \*, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
|
.. class:: Unpickler(file, *, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
|
||||||
|
|
||||||
This takes a binary file for reading a pickle data stream.
|
This takes a binary file for reading a pickle data stream.
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ or :class:`datetime.datetime` objects.
|
||||||
|
|
||||||
This module defines the following functions:
|
This module defines the following functions:
|
||||||
|
|
||||||
.. function:: load(fp, \*, fmt=None, dict_type=dict)
|
.. function:: load(fp, *, fmt=None, dict_type=dict)
|
||||||
|
|
||||||
Read a plist file. *fp* should be a readable and binary file object.
|
Read a plist file. *fp* should be a readable and binary file object.
|
||||||
Return the unpacked root object (which usually is a
|
Return the unpacked root object (which usually is a
|
||||||
|
@ -80,7 +80,7 @@ This module defines the following functions:
|
||||||
.. versionadded:: 3.4
|
.. versionadded:: 3.4
|
||||||
|
|
||||||
|
|
||||||
.. function:: loads(data, \*, fmt=None, dict_type=dict)
|
.. function:: loads(data, *, fmt=None, dict_type=dict)
|
||||||
|
|
||||||
Load a plist from a bytes object. See :func:`load` for an explanation of
|
Load a plist from a bytes object. See :func:`load` for an explanation of
|
||||||
the keyword arguments.
|
the keyword arguments.
|
||||||
|
@ -88,7 +88,7 @@ This module defines the following functions:
|
||||||
.. versionadded:: 3.4
|
.. versionadded:: 3.4
|
||||||
|
|
||||||
|
|
||||||
.. function:: dump(value, fp, \*, fmt=FMT_XML, sort_keys=True, skipkeys=False)
|
.. function:: dump(value, fp, *, fmt=FMT_XML, sort_keys=True, skipkeys=False)
|
||||||
|
|
||||||
Write *value* to a plist file. *Fp* should be a writable, binary
|
Write *value* to a plist file. *Fp* should be a writable, binary
|
||||||
file object.
|
file object.
|
||||||
|
@ -116,7 +116,7 @@ This module defines the following functions:
|
||||||
.. versionadded:: 3.4
|
.. versionadded:: 3.4
|
||||||
|
|
||||||
|
|
||||||
.. function:: dumps(value, \*, fmt=FMT_XML, sort_keys=True, skipkeys=False)
|
.. function:: dumps(value, *, fmt=FMT_XML, sort_keys=True, skipkeys=False)
|
||||||
|
|
||||||
Return *value* as a plist-formatted bytes object. See
|
Return *value* as a plist-formatted bytes object. See
|
||||||
the documentation for :func:`dump` for an explanation of the keyword
|
the documentation for :func:`dump` for an explanation of the keyword
|
||||||
|
|
|
@ -218,7 +218,7 @@ Directory and files operations
|
||||||
copy the file more efficiently. See
|
copy the file more efficiently. See
|
||||||
:ref:`shutil-platform-dependent-efficient-copy-operations` section.
|
:ref:`shutil-platform-dependent-efficient-copy-operations` section.
|
||||||
|
|
||||||
.. function:: ignore_patterns(\*patterns)
|
.. function:: ignore_patterns(*patterns)
|
||||||
|
|
||||||
This factory function creates a function that can be used as a callable for
|
This factory function creates a function that can be used as a callable for
|
||||||
:func:`copytree`\'s *ignore* argument, ignoring files and directories that
|
:func:`copytree`\'s *ignore* argument, ignoring files and directories that
|
||||||
|
|
|
@ -478,7 +478,7 @@ class`. In addition, it provides a few more methods:
|
||||||
|
|
||||||
.. versionadded:: 3.1
|
.. versionadded:: 3.1
|
||||||
|
|
||||||
.. method:: int.to_bytes(length, byteorder, \*, signed=False)
|
.. method:: int.to_bytes(length, byteorder, *, signed=False)
|
||||||
|
|
||||||
Return an array of bytes representing an integer.
|
Return an array of bytes representing an integer.
|
||||||
|
|
||||||
|
@ -510,7 +510,7 @@ class`. In addition, it provides a few more methods:
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
.. classmethod:: int.from_bytes(bytes, byteorder, \*, signed=False)
|
.. classmethod:: int.from_bytes(bytes, byteorder, *, signed=False)
|
||||||
|
|
||||||
Return the integer represented by the given array of bytes.
|
Return the integer represented by the given array of bytes.
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,7 @@ functions.
|
||||||
stderr=None, preexec_fn=None, close_fds=True, shell=False, \
|
stderr=None, preexec_fn=None, close_fds=True, shell=False, \
|
||||||
cwd=None, env=None, universal_newlines=None, \
|
cwd=None, env=None, universal_newlines=None, \
|
||||||
startupinfo=None, creationflags=0, restore_signals=True, \
|
startupinfo=None, creationflags=0, restore_signals=True, \
|
||||||
start_new_session=False, pass_fds=(), \*, group=None, \
|
start_new_session=False, pass_fds=(), *, group=None, \
|
||||||
extra_groups=None, user=None, umask=-1, \
|
extra_groups=None, user=None, umask=-1, \
|
||||||
encoding=None, errors=None, text=None)
|
encoding=None, errors=None, text=None)
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ can be accessed using :func:`get_config_vars` or :func:`get_config_var`.
|
||||||
|
|
||||||
Notice that on Windows, it's a much smaller set.
|
Notice that on Windows, it's a much smaller set.
|
||||||
|
|
||||||
.. function:: get_config_vars(\*args)
|
.. function:: get_config_vars(*args)
|
||||||
|
|
||||||
With no arguments, return a dictionary of all configuration variables
|
With no arguments, return a dictionary of all configuration variables
|
||||||
relevant for the current platform.
|
relevant for the current platform.
|
||||||
|
|
|
@ -37,7 +37,7 @@ Some facts and figures:
|
||||||
Added support for :mod:`lzma` compression.
|
Added support for :mod:`lzma` compression.
|
||||||
|
|
||||||
|
|
||||||
.. function:: open(name=None, mode='r', fileobj=None, bufsize=10240, \*\*kwargs)
|
.. function:: open(name=None, mode='r', fileobj=None, bufsize=10240, **kwargs)
|
||||||
|
|
||||||
Return a :class:`TarFile` object for the pathname *name*. For detailed
|
Return a :class:`TarFile` object for the pathname *name*. For detailed
|
||||||
information on :class:`TarFile` objects and the keyword arguments that are
|
information on :class:`TarFile` objects and the keyword arguments that are
|
||||||
|
|
|
@ -546,7 +546,7 @@ The :mod:`test.support` module defines the following functions:
|
||||||
Define match test with regular expression *patterns*.
|
Define match test with regular expression *patterns*.
|
||||||
|
|
||||||
|
|
||||||
.. function:: run_unittest(\*classes)
|
.. function:: run_unittest(*classes)
|
||||||
|
|
||||||
Execute :class:`unittest.TestCase` subclasses passed to the function. The
|
Execute :class:`unittest.TestCase` subclasses passed to the function. The
|
||||||
function scans the classes for methods starting with the prefix ``test_``
|
function scans the classes for methods starting with the prefix ``test_``
|
||||||
|
|
|
@ -491,7 +491,7 @@ Available Functions
|
||||||
Available Context Managers
|
Available Context Managers
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
.. class:: catch_warnings(\*, record=False, module=None)
|
.. class:: catch_warnings(*, record=False, module=None)
|
||||||
|
|
||||||
A context manager that copies and, upon exit, restores the warnings filter
|
A context manager that copies and, upon exit, restores the warnings filter
|
||||||
and the :func:`showwarning` function.
|
and the :func:`showwarning` function.
|
||||||
|
|
|
@ -791,7 +791,7 @@ integer handle, and also disconnect the Windows handle from the handle object.
|
||||||
|
|
||||||
|
|
||||||
.. method:: PyHKEY.__enter__()
|
.. method:: PyHKEY.__enter__()
|
||||||
PyHKEY.__exit__(\*exc_info)
|
PyHKEY.__exit__(*exc_info)
|
||||||
|
|
||||||
The HKEY object implements :meth:`~object.__enter__` and
|
The HKEY object implements :meth:`~object.__enter__` and
|
||||||
:meth:`~object.__exit__` and thus supports the context protocol for the
|
:meth:`~object.__exit__` and thus supports the context protocol for the
|
||||||
|
|
|
@ -174,7 +174,7 @@ module documentation. This section lists the differences between the API and
|
||||||
The :meth:`toxml` method now preserves the attribute order specified
|
The :meth:`toxml` method now preserves the attribute order specified
|
||||||
by the user.
|
by the user.
|
||||||
|
|
||||||
.. method:: Node.toprettyxml(indent="\\t", newl="\\n", encoding=None, \
|
.. method:: Node.toprettyxml(indent="\t", newl="\n", encoding=None, \
|
||||||
standalone=None)
|
standalone=None)
|
||||||
|
|
||||||
Return a pretty-printed version of the document. *indent* specifies the
|
Return a pretty-printed version of the document. *indent* specifies the
|
||||||
|
|
Loading…
Reference in New Issue