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

Skip to content

Commit 2223320

Browse files
committed
Deploying to gh-pages from @ 99fa2cc 🚀
1 parent 68ed02f commit 2223320

File tree

627 files changed

+8170
-7887
lines changed

Some content is hidden

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

627 files changed

+8170
-7887
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: cd406a0b73e8d25d9ccf3aa91361322e
3+
config: 037987daf5d6d51af187eb1d02998158
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_sources/c-api/datetime.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,10 @@ Macros for the convenience of modules implementing the DB API:
318318
.. c:function:: PyObject* PyDateTime_FromTimestamp(PyObject *args)
319319
320320
Create and return a new :class:`datetime.datetime` object given an argument
321-
tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp()`.
321+
tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp`.
322322
323323
324324
.. c:function:: PyObject* PyDate_FromTimestamp(PyObject *args)
325325
326326
Create and return a new :class:`datetime.date` object given an argument
327-
tuple suitable for passing to :meth:`datetime.date.fromtimestamp()`.
327+
tuple suitable for passing to :meth:`datetime.date.fromtimestamp`.

_sources/c-api/exceptions.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ propagated, additional calls into the Python/C API may not behave as intended
3434
and may fail in mysterious ways.
3535

3636
.. note::
37-
The error indicator is **not** the result of :func:`sys.exc_info()`.
37+
The error indicator is **not** the result of :func:`sys.exc_info`.
3838
The former corresponds to an exception that is not yet caught (and is
3939
therefore still propagating), while the latter returns an exception after
4040
it is caught (and has therefore stopped propagating).

_sources/c-api/import.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Importing Modules
174174
175175
.. versionadded:: 3.2
176176
.. versionchanged:: 3.3
177-
Uses :func:`!imp.source_from_cache()` in calculating the source path if
177+
Uses :func:`!imp.source_from_cache` in calculating the source path if
178178
only the bytecode path is provided.
179179
.. versionchanged:: 3.12
180180
No longer uses the removed :mod:`!imp` module.

_sources/c-api/init_config.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ PyPreConfig
311311
* Set :c:member:`PyConfig.filesystem_encoding` to ``"mbcs"``,
312312
* Set :c:member:`PyConfig.filesystem_errors` to ``"replace"``.
313313
314-
Initialized the from :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment
314+
Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment
315315
variable value.
316316
317317
Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for

_sources/deprecations/pending-removal-in-3.13.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ APIs:
4848
* ``read_binary()``
4949
* ``read_text()``
5050

51-
Use :func:`importlib.resources.files()` instead. Refer to `importlib-resources: Migrating from Legacy
51+
Use :func:`importlib.resources.files` instead. Refer to `importlib-resources: Migrating from Legacy
5252
<https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy>`_ (:gh:`106531`)

_sources/deprecations/pending-removal-in-3.15.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Pending Removal in Python 3.15
99
* :class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python 3.11
1010
and originally planned for removal in Python 3.13 (:gh:`90817`),
1111
but removal has been postponed to Python 3.15.
12-
Use :func:`locale.setlocale()`, :func:`locale.getencoding()` and
13-
:func:`locale.getlocale()` instead.
12+
Use :func:`locale.setlocale`, :func:`locale.getencoding` and
13+
:func:`locale.getlocale` instead.
1414
(Contributed by Hugo van Kemenade in :gh:`111187`.)
1515

1616
* :mod:`pathlib`:

_sources/extending/newtypes_tutorial.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ Further, the attributes can be deleted, setting the C pointers to ``NULL``. Eve
449449
though we can make sure the members are initialized to non-``NULL`` values, the
450450
members can be set to ``NULL`` if the attributes are deleted.
451451

452-
We define a single method, :meth:`!Custom.name()`, that outputs the objects name as the
452+
We define a single method, :meth:`!Custom.name`, that outputs the objects name as the
453453
concatenation of the first and last names. ::
454454

455455
static PyObject *

_sources/faq/programming.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ Not as such.
10131013
For simple input parsing, the easiest approach is usually to split the line into
10141014
whitespace-delimited words using the :meth:`~str.split` method of string objects
10151015
and then convert decimal strings to numeric values using :func:`int` or
1016-
:func:`float`. :meth:`!split()` supports an optional "sep" parameter which is useful
1016+
:func:`float`. :meth:`!split` supports an optional "sep" parameter which is useful
10171017
if the line uses something other than whitespace as a separator.
10181018

10191019
For more complicated input parsing, regular expressions are more powerful

_sources/glossary.rst.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,14 @@ Glossary
591591
:ref:`idle` is a basic editor and interpreter environment
592592
which ships with the standard distribution of Python.
593593

594+
immortal
595+
*Immortal objects* are a CPython implementation detail introduced
596+
in :pep:`683`.
597+
598+
If an object is immortal, its :term:`reference count` is never modified,
599+
and therefore it is never deallocated while the interpreter is running.
600+
For example, :const:`True` and :const:`None` are immortal in CPython.
601+
594602
immutable
595603
An object with a fixed value. Immutable objects include numbers, strings and
596604
tuples. Such an object cannot be altered. A new object has to

_sources/howto/descriptor.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ were defined.
513513

514514
Descriptors are a powerful, general purpose protocol. They are the mechanism
515515
behind properties, methods, static methods, class methods, and
516-
:func:`super()`. They are used throughout Python itself. Descriptors
516+
:func:`super`. They are used throughout Python itself. Descriptors
517517
simplify the underlying C code and offer a flexible set of new tools for
518518
everyday Python programs.
519519

@@ -803,7 +803,7 @@ The full C implementation can be found in :c:func:`!super_getattro` in
803803
Summary of invocation logic
804804
---------------------------
805805

806-
The mechanism for descriptors is embedded in the :meth:`__getattribute__()`
806+
The mechanism for descriptors is embedded in the :meth:`__getattribute__`
807807
methods for :class:`object`, :class:`type`, and :func:`super`.
808808

809809
The important points to remember are:

_sources/howto/enum.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Enum HOWTO
77
.. currentmodule:: enum
88

99
An :class:`Enum` is a set of symbolic names bound to unique values. They are
10-
similar to global variables, but they offer a more useful :func:`repr()`,
10+
similar to global variables, but they offer a more useful :func:`repr`,
1111
grouping, type-safety, and a few other features.
1212

1313
They are most useful when you have a variable that can take one of a limited
@@ -165,7 +165,7 @@ And a function to display the chores for a given day::
165165
answer SO questions
166166

167167
In cases where the actual values of the members do not matter, you can save
168-
yourself some work and use :func:`auto()` for the values::
168+
yourself some work and use :func:`auto` for the values::
169169

170170
>>> from enum import auto
171171
>>> class Weekday(Flag):

_sources/howto/instrumentation.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ Available static markers
307307
.. object:: gc__start(int generation)
308308

309309
Fires when the Python interpreter starts a garbage collection cycle.
310-
``arg0`` is the generation to scan, like :func:`gc.collect()`.
310+
``arg0`` is the generation to scan, like :func:`gc.collect`.
311311

312312
.. object:: gc__done(long collected)
313313

_sources/howto/logging.rst.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ Logging Flow
381381
The flow of log event information in loggers and handlers is illustrated in the
382382
following diagram.
383383

384+
.. only:: not html
385+
386+
.. image:: logging_flow.*
387+
384388
.. raw:: html
385389
:file: logging_flow.svg
386390

_sources/library/ast.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2171,7 +2171,7 @@ and classes for traversing abstract syntax trees:
21712171
If ``type_comments=True`` is given, the parser is modified to check
21722172
and return type comments as specified by :pep:`484` and :pep:`526`.
21732173
This is equivalent to adding :data:`ast.PyCF_TYPE_COMMENTS` to the
2174-
flags passed to :func:`compile()`. This will report syntax errors
2174+
flags passed to :func:`compile`. This will report syntax errors
21752175
for misplaced type comments. Without this flag, type comments will
21762176
be ignored, and the ``type_comment`` field on selected AST nodes
21772177
will always be ``None``. In addition, the locations of ``# type:

_sources/library/asyncio-eventloop.rst.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Running and stopping the loop
126126

127127
Run the event loop until :meth:`stop` is called.
128128

129-
If :meth:`stop` is called before :meth:`run_forever()` is called,
129+
If :meth:`stop` is called before :meth:`run_forever` is called,
130130
the loop will poll the I/O selector once with a timeout of zero,
131131
run all callbacks scheduled in response to I/O events (and
132132
those that were already scheduled), and then exit.
@@ -165,7 +165,7 @@ Running and stopping the loop
165165
.. coroutinemethod:: loop.shutdown_asyncgens()
166166

167167
Schedule all currently open :term:`asynchronous generator` objects to
168-
close with an :meth:`~agen.aclose()` call. After calling this method,
168+
close with an :meth:`~agen.aclose` call. After calling this method,
169169
the event loop will issue a warning if a new asynchronous generator
170170
is iterated. This should be used to reliably finalize all scheduled
171171
asynchronous generators.
@@ -1386,7 +1386,7 @@ Allows customizing how exceptions are handled in the event loop.
13861386

13871387
This method should not be overloaded in subclassed
13881388
event loops. For custom exception handling, use
1389-
the :meth:`set_exception_handler()` method.
1389+
the :meth:`set_exception_handler` method.
13901390

13911391
Enabling debug mode
13921392
^^^^^^^^^^^^^^^^^^^
@@ -1469,7 +1469,7 @@ async/await code consider using the high-level
14691469
* *stdin* can be any of these:
14701470

14711471
* a file-like object
1472-
* an existing file descriptor (a positive integer), for example those created with :meth:`os.pipe()`
1472+
* an existing file descriptor (a positive integer), for example those created with :meth:`os.pipe`
14731473
* the :const:`subprocess.PIPE` constant (default) which will create a new
14741474
pipe and connect it,
14751475
* the value ``None`` which will make the subprocess inherit the file

_sources/library/asyncio-llapi-index.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ See also the main documentation section about the
5656
* - :meth:`loop.close`
5757
- Close the event loop.
5858

59-
* - :meth:`loop.is_running()`
59+
* - :meth:`loop.is_running`
6060
- Return ``True`` if the event loop is running.
6161

62-
* - :meth:`loop.is_closed()`
62+
* - :meth:`loop.is_closed`
6363
- Return ``True`` if the event loop is closed.
6464

6565
* - ``await`` :meth:`loop.shutdown_asyncgens`

_sources/library/asyncio-queue.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Queue
5555
Return ``True`` if there are :attr:`maxsize` items in the queue.
5656

5757
If the queue was initialized with ``maxsize=0`` (the default),
58-
then :meth:`full()` never returns ``True``.
58+
then :meth:`full` never returns ``True``.
5959

6060
.. coroutinemethod:: get()
6161

_sources/library/asyncio-runner.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Runner context manager
8989
current one. By default :func:`asyncio.new_event_loop` is used and set as
9090
current event loop with :func:`asyncio.set_event_loop` if *loop_factory* is ``None``.
9191

92-
Basically, :func:`asyncio.run()` example can be rewritten with the runner usage::
92+
Basically, :func:`asyncio.run` example can be rewritten with the runner usage::
9393

9494
async def main():
9595
await asyncio.sleep(1)

_sources/library/collections.abc.rst.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ Collections Abstract Base Classes -- Detailed Descriptions
216216

217217
ABC for classes that provide the :meth:`~object.__call__` method.
218218

219+
See :ref:`annotating-callables` for details on how to use
220+
:class:`!Callable` in type annotations.
221+
219222
.. class:: Iterable
220223

221224
ABC for classes that provide the :meth:`~container.__iter__` method.
@@ -253,6 +256,9 @@ Collections Abstract Base Classes -- Detailed Descriptions
253256
:meth:`~generator.send`,
254257
:meth:`~generator.throw` and :meth:`~generator.close` methods.
255258

259+
See :ref:`annotating-generators-and-coroutines`
260+
for details on using :class:`!Generator` in type annotations.
261+
256262
.. versionadded:: 3.5
257263

258264
.. class:: Sequence
@@ -331,6 +337,11 @@ Collections Abstract Base Classes -- Detailed Descriptions
331337
Using ``isinstance(gencoro, Coroutine)`` for them will return ``False``.
332338
Use :func:`inspect.isawaitable` to detect them.
333339

340+
See :ref:`annotating-generators-and-coroutines`
341+
for details on using :class:`!Coroutine` in type annotations.
342+
The variance and order of type parameters correspond to those of
343+
:class:`Generator`.
344+
334345
.. versionadded:: 3.5
335346

336347
.. class:: AsyncIterable
@@ -352,6 +363,9 @@ Collections Abstract Base Classes -- Detailed Descriptions
352363
ABC for :term:`asynchronous generator` classes that implement the protocol
353364
defined in :pep:`525` and :pep:`492`.
354365

366+
See :ref:`annotating-generators-and-coroutines`
367+
for details on using :class:`!AsyncGenerator` in type annotations.
368+
355369
.. versionadded:: 3.6
356370

357371
.. class:: Buffer

_sources/library/compileall.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ compile Python sources.
9090
.. option:: -j N
9191

9292
Use *N* workers to compile the files within the given directory.
93-
If ``0`` is used, then the result of :func:`os.cpu_count()`
93+
If ``0`` is used, then the result of :func:`os.cpu_count`
9494
will be used.
9595

9696
.. option:: --invalidation-mode [timestamp|checked-hash|unchecked-hash]

_sources/library/configparser.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ ConfigParser Objects
960960
When *converters* is given, it should be a dictionary where each key
961961
represents the name of a type converter and each value is a callable
962962
implementing the conversion from string to the desired datatype. Every
963-
converter gets its own corresponding :meth:`!get*()` method on the parser
963+
converter gets its own corresponding :meth:`!get*` method on the parser
964964
object and section proxies.
965965

966966
It is possible to read several configurations into a single
@@ -1000,7 +1000,7 @@ ConfigParser Objects
10001000
The *converters* argument was added.
10011001

10021002
.. versionchanged:: 3.7
1003-
The *defaults* argument is read with :meth:`read_dict()`,
1003+
The *defaults* argument is read with :meth:`read_dict`,
10041004
providing consistent behavior across the parser: non-string
10051005
keys and values are implicitly converted to strings.
10061006

_sources/library/constants.rst.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ A small number of constants live in the built-in namespace. They are:
7979
:exc:`SyntaxError`), so they can be considered "true" constants.
8080

8181

82+
.. _site-consts:
83+
8284
Constants added by the :mod:`site` module
8385
-----------------------------------------
8486

@@ -94,6 +96,13 @@ should not be used in programs.
9496
(i.e. EOF) to exit", and when called, raise :exc:`SystemExit` with the
9597
specified exit code.
9698

99+
.. data:: help
100+
:noindex:
101+
102+
Object that when printed, prints the message "Type help() for interactive
103+
help, or help(object) for help about object.", and when called,
104+
acts as described :func:`elsewhere <help>`.
105+
97106
.. data:: copyright
98107
credits
99108

_sources/library/contextvars.rst.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function and the :class:`~contextvars.Context` class should be used to
1515
manage the current context in asynchronous frameworks.
1616

1717
Context managers that have state should use Context Variables
18-
instead of :func:`threading.local()` to prevent their state from
18+
instead of :func:`threading.local` to prevent their state from
1919
bleeding to other code unexpectedly, when used in concurrent code.
2020

2121
See also :pep:`567` for additional details.
@@ -146,7 +146,7 @@ Manual Context Management
146146

147147
Every thread will have a different top-level :class:`~contextvars.Context`
148148
object. This means that a :class:`ContextVar` object behaves in a similar
149-
fashion to :func:`threading.local()` when values are assigned in different
149+
fashion to :func:`threading.local` when values are assigned in different
150150
threads.
151151

152152
Context implements the :class:`collections.abc.Mapping` interface.
@@ -254,7 +254,7 @@ client::
254254
# without passing it explicitly to this function.
255255

256256
client_addr = client_addr_var.get()
257-
return f'Good bye, client @ {client_addr}\n'.encode()
257+
return f'Good bye, client @ {client_addr}\r\n'.encode()
258258

259259
async def handle_request(reader, writer):
260260
addr = writer.transport.get_extra_info('socket').getpeername()
@@ -268,9 +268,10 @@ client::
268268
print(line)
269269
if not line.strip():
270270
break
271-
writer.write(line)
272271

273-
writer.write(render_goodbye())
272+
writer.write(b'HTTP/1.1 200 OK\r\n') # status line
273+
writer.write(b'\r\n') # headers
274+
writer.write(render_goodbye()) # body
274275
writer.close()
275276

276277
async def main():
@@ -282,5 +283,6 @@ client::
282283

283284
asyncio.run(main())
284285

285-
# To test it you can use telnet:
286+
# To test it you can use telnet or curl:
286287
# telnet 127.0.0.1 8081
288+
# curl 127.0.0.1:8081

0 commit comments

Comments
 (0)