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

Skip to content

Commit cb1641b

Browse files
committed
Deploying to gh-pages from @ e2bf6ce 🚀
1 parent 90722a8 commit cb1641b

File tree

598 files changed

+9931
-9135
lines changed

Some content is hidden

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

598 files changed

+9931
-9135
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 records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 6cf0775369be5d8a262285b94041e119
3+
config: d0f7e7491a617318ea66f31d3f61c0ee
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_sources/c-api/init.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
14481448
14491449
.. c:function:: PyObject* PyUnstable_InterpreterState_GetMainModule(PyInterpreterState *interp)
14501450
1451-
Return a :term:`strong reference` to the ``__main__`` `module object <moduleobjects>`_
1451+
Return a :term:`strong reference` to the ``__main__`` :ref:`module object <moduleobjects>`
14521452
for the given interpreter.
14531453
14541454
The caller must hold the GIL.

_sources/c-api/module.rst.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,6 @@ state:
523523
524524
On success, return ``0``. On error, raise an exception and return ``-1``.
525525
526-
Return ``-1`` if *value* is ``NULL``. It must be called with an exception
527-
raised in this case.
528-
529526
Example usage::
530527
531528
static int
@@ -540,6 +537,10 @@ state:
540537
return res;
541538
}
542539
540+
To be convenient, the function accepts ``NULL`` *value* with an exception
541+
set. In this case, return ``-1`` and just leave the raised exception
542+
unchanged.
543+
543544
The example can also be written without checking explicitly if *obj* is
544545
``NULL``::
545546

_sources/c-api/unicode.rst.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,15 @@ These are the UTF-8 codec APIs:
10541054
10551055
As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size.
10561056
1057+
.. warning::
1058+
1059+
This function does not have any special behavior for
1060+
`null characters <https://en.wikipedia.org/wiki/Null_character>`_ embedded within
1061+
*unicode*. As a result, strings containing null characters will remain in the returned
1062+
string, which some C functions might interpret as the end of the string, leading to
1063+
truncation. If truncation is an issue, it is recommended to use :c:func:`PyUnicode_AsUTF8AndSize`
1064+
instead.
1065+
10571066
.. versionadded:: 3.3
10581067
10591068
.. versionchanged:: 3.7

_sources/c-api/veryhigh.rst.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,20 @@ the same library that the Python runtime is using.
348348
.. versionchanged:: 3.8
349349
Added *cf_feature_version* field.
350350
351+
The available compiler flags are accessible as macros:
351352
352-
.. c:var:: int CO_FUTURE_DIVISION
353+
.. c:namespace:: NULL
353354
354-
This bit can be set in *flags* to cause division operator ``/`` to be
355-
interpreted as "true division" according to :pep:`238`.
355+
.. c:macro:: PyCF_ALLOW_TOP_LEVEL_AWAIT
356+
PyCF_ONLY_AST
357+
PyCF_OPTIMIZED_AST
358+
PyCF_TYPE_COMMENTS
359+
360+
See :ref:`compiler flags <ast-compiler-flags>` in documentation of the
361+
:py:mod:`!ast` Python module, which exports these constants under
362+
the same names.
363+
364+
.. c:var:: int CO_FUTURE_DIVISION
365+
366+
This bit can be set in *flags* to cause division operator ``/`` to be
367+
interpreted as "true division" according to :pep:`238`.

_sources/faq/programming.rst.txt

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,28 +1906,30 @@ In the standard library code, you will see several common patterns for
19061906
correctly using identity tests:
19071907

19081908
1) As recommended by :pep:`8`, an identity test is the preferred way to check
1909-
for ``None``. This reads like plain English in code and avoids confusion with
1910-
other objects that may have boolean values that evaluate to false.
1909+
for ``None``. This reads like plain English in code and avoids confusion
1910+
with other objects that may have boolean values that evaluate to false.
19111911

19121912
2) Detecting optional arguments can be tricky when ``None`` is a valid input
1913-
value. In those situations, you can create a singleton sentinel object
1914-
guaranteed to be distinct from other objects. For example, here is how
1915-
to implement a method that behaves like :meth:`dict.pop`::
1913+
value. In those situations, you can create a singleton sentinel object
1914+
guaranteed to be distinct from other objects. For example, here is how
1915+
to implement a method that behaves like :meth:`dict.pop`:
19161916

1917-
_sentinel = object()
1917+
.. code-block:: python
19181918
1919-
def pop(self, key, default=_sentinel):
1920-
if key in self:
1921-
value = self[key]
1922-
del self[key]
1923-
return value
1924-
if default is _sentinel:
1925-
raise KeyError(key)
1926-
return default
1919+
_sentinel = object()
1920+
1921+
def pop(self, key, default=_sentinel):
1922+
if key in self:
1923+
value = self[key]
1924+
del self[key]
1925+
return value
1926+
if default is _sentinel:
1927+
raise KeyError(key)
1928+
return default
19271929
19281930
3) Container implementations sometimes need to augment equality tests with
1929-
identity tests. This prevents the code from being confused by objects such as
1930-
``float('NaN')`` that are not equal to themselves.
1931+
identity tests. This prevents the code from being confused by objects
1932+
such as ``float('NaN')`` that are not equal to themselves.
19311933

19321934
For example, here is the implementation of
19331935
:meth:`!collections.abc.Sequence.__contains__`::

_sources/glossary.rst.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Glossary
110110
:keyword:`yield` expression.
111111

112112
Each :keyword:`yield` temporarily suspends processing, remembering the
113-
location execution state (including local variables and pending
113+
execution state (including local variables and pending
114114
try-statements). When the *asynchronous generator iterator* effectively
115115
resumes with another awaitable returned by :meth:`~object.__anext__`, it
116116
picks up where it left off. See :pep:`492` and :pep:`525`.
@@ -554,7 +554,7 @@ Glossary
554554
An object created by a :term:`generator` function.
555555

556556
Each :keyword:`yield` temporarily suspends processing, remembering the
557-
location execution state (including local variables and pending
557+
execution state (including local variables and pending
558558
try-statements). When the *generator iterator* resumes, it picks up where
559559
it left off (in contrast to functions which start fresh on every
560560
invocation).
@@ -801,9 +801,11 @@ Glossary
801801
processed.
802802

803803
loader
804-
An object that loads a module. It must define a method named
805-
:meth:`load_module`. A loader is typically returned by a
806-
:term:`finder`. See also:
804+
An object that loads a module.
805+
It must define the :meth:`!exec_module` and :meth:`!create_module` methods
806+
to implement the :class:`~importlib.abc.Loader` interface.
807+
A loader is typically returned by a :term:`finder`.
808+
See also:
807809

808810
* :ref:`finders-and-loaders`
809811
* :class:`importlib.abc.Loader`

_sources/howto/free-threading-python.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Identifying free-threaded Python
4343
================================
4444

4545
To check if the current interpreter supports free-threading, :option:`python -VV <-V>`
46-
and :attr:`sys.version` contain "experimental free-threading build".
46+
and :data:`sys.version` contain "experimental free-threading build".
4747
The new :func:`sys._is_gil_enabled` function can be used to check whether
4848
the GIL is actually disabled in the running process.
4949

_sources/howto/mro.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ with inheritance diagram
398398
399399
We see that class G inherits from F and E, with F *before* E: therefore
400400
we would expect the attribute *G.remember2buy* to be inherited by
401-
*F.rembermer2buy* and not by *E.remember2buy*: nevertheless Python 2.2
401+
*F.remember2buy* and not by *E.remember2buy*: nevertheless Python 2.2
402402
gives
403403

404404
>>> G.remember2buy # doctest: +SKIP

_sources/library/datetime.rst.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The :mod:`!datetime` module exports the following constants:
9393
The largest year number allowed in a :class:`date` or :class:`.datetime` object.
9494
:const:`MAXYEAR` is 9999.
9595

96-
.. attribute:: UTC
96+
.. data:: UTC
9797

9898
Alias for the UTC time zone singleton :attr:`datetime.timezone.utc`.
9999

@@ -937,7 +937,7 @@ Other constructors, all class methods:
937937

938938
.. deprecated:: 3.12
939939

940-
Use :meth:`datetime.now` with :attr:`UTC` instead.
940+
Use :meth:`datetime.now` with :const:`UTC` instead.
941941

942942

943943
.. classmethod:: datetime.fromtimestamp(timestamp, tz=None)
@@ -1009,7 +1009,7 @@ Other constructors, all class methods:
10091009

10101010
.. deprecated:: 3.12
10111011

1012-
Use :meth:`datetime.fromtimestamp` with :attr:`UTC` instead.
1012+
Use :meth:`datetime.fromtimestamp` with :const:`UTC` instead.
10131013

10141014

10151015
.. classmethod:: datetime.fromordinal(ordinal)

_sources/library/decimal.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2245,7 +2245,7 @@ value for :attr:`~Context.prec` as well [#]_::
22452245
Decimal('904625697166532776746648320380374280103671755200316906558262375061821325312')
22462246

22472247

2248-
For inexact results, :attr:`MAX_PREC` is far too large on 64-bit platforms and
2248+
For inexact results, :const:`MAX_PREC` is far too large on 64-bit platforms and
22492249
the available memory will be insufficient::
22502250

22512251
>>> Decimal(1) / 3

_sources/library/email.contentmanager.rst.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,13 @@ Currently the email package provides only one concrete content manager,
157157
:exc:`ValueError`.
158158

159159
* For ``str`` objects, if *cte* is not set use heuristics to
160-
determine the most compact encoding.
160+
determine the most compact encoding. Prior to encoding,
161+
:meth:`str.splitlines` is used to normalize all line boundaries,
162+
ensuring that each line of the payload is terminated by the
163+
current policy's :data:`~email.policy.Policy.linesep` property
164+
(even if the original string did not end with one).
165+
* For ``bytes`` objects, *cte* is taken to be base64 if not set,
166+
and the aforementioned newline translation is not performed.
161167
* For :class:`~email.message.EmailMessage`, per :rfc:`2046`, raise
162168
an error if a *cte* of ``quoted-printable`` or ``base64`` is
163169
requested for *subtype* ``rfc822``, and for any *cte* other than

_sources/library/errno.rst.txt

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,171 @@ defined by the module. The specific list of defined symbols is available as
665665

666666
.. versionadded:: 3.11
667667

668+
669+
.. data:: ENOMEDIUM
670+
671+
No medium found
672+
673+
674+
.. data:: EMEDIUMTYPE
675+
676+
Wrong medium type
677+
678+
679+
.. data:: ENOKEY
680+
681+
Required key not available
682+
683+
684+
.. data:: EKEYEXPIRED
685+
686+
Key has expired
687+
688+
689+
.. data:: EKEYREVOKED
690+
691+
Key has been revoked
692+
693+
694+
.. data:: EKEYREJECTED
695+
696+
Key was rejected by service
697+
698+
699+
.. data:: ERFKILL
700+
701+
Operation not possible due to RF-kill
702+
703+
704+
.. data:: ELOCKUNMAPPED
705+
706+
Locked lock was unmapped
707+
708+
709+
.. data:: ENOTACTIVE
710+
711+
Facility is not active
712+
713+
714+
.. data:: EAUTH
715+
716+
Authentication error
717+
718+
.. versionadded:: 3.2
719+
720+
721+
.. data:: EBADARCH
722+
723+
Bad CPU type in executable
724+
725+
.. versionadded:: 3.2
726+
727+
728+
.. data:: EBADEXEC
729+
730+
Bad executable (or shared library)
731+
732+
.. versionadded:: 3.2
733+
734+
735+
.. data:: EBADMACHO
736+
737+
Malformed Mach-o file
738+
739+
.. versionadded:: 3.2
740+
741+
742+
.. data:: EDEVERR
743+
744+
Device error
745+
746+
.. versionadded:: 3.2
747+
748+
749+
.. data:: EFTYPE
750+
751+
Inappropriate file type or format
752+
753+
.. versionadded:: 3.2
754+
755+
756+
.. data:: ENEEDAUTH
757+
758+
Need authenticator
759+
760+
.. versionadded:: 3.2
761+
762+
763+
.. data:: ENOATTR
764+
765+
Attribute not found
766+
767+
.. versionadded:: 3.2
768+
769+
770+
.. data:: ENOPOLICY
771+
772+
Policy not found
773+
774+
.. versionadded:: 3.2
775+
776+
777+
.. data:: EPROCLIM
778+
779+
Too many processes
780+
781+
.. versionadded:: 3.2
782+
783+
784+
.. data:: EPROCUNAVAIL
785+
786+
Bad procedure for program
787+
788+
.. versionadded:: 3.2
789+
790+
791+
.. data:: EPROGMISMATCH
792+
793+
Program version wrong
794+
795+
.. versionadded:: 3.2
796+
797+
798+
.. data:: EPROGUNAVAIL
799+
800+
RPC prog. not avail
801+
802+
.. versionadded:: 3.2
803+
804+
805+
.. data:: EPWROFF
806+
807+
Device power is off
808+
809+
.. versionadded:: 3.2
810+
811+
812+
.. data:: EBADRPC
813+
814+
RPC struct is bad
815+
816+
.. versionadded:: 3.2
817+
818+
819+
.. data:: ERPCMISMATCH
820+
821+
RPC version wrong
822+
823+
.. versionadded:: 3.2
824+
825+
826+
.. data:: ESHLIBVERS
827+
828+
Shared library version mismatch
829+
830+
.. versionadded:: 3.2
831+
832+
668833
.. data:: ENOTCAPABLE
669834

670835
Capabilities insufficient. This error is mapped to the exception

0 commit comments

Comments
 (0)