Skip to content

Commit e944f12

Browse files
committed
Merge remote-tracking branch 'original/main' into develop
2 parents f69d2b7 + bc5356b commit e944f12

File tree

143 files changed

+2877
-1992
lines changed

Some content is hidden

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

143 files changed

+2877
-1992
lines changed

Doc/library/calendar.rst

Lines changed: 72 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -28,58 +28,6 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
2828
2 BC, and so on.
2929

3030

31-
.. class:: Day
32-
33-
Enumeration defining the days of the week as integer constants, from 0 to 6.
34-
35-
.. attribute:: MONDAY
36-
37-
.. attribute:: TUESDAY
38-
39-
.. attribute:: WEDNESDAY
40-
41-
.. attribute:: THURSDAY
42-
43-
.. attribute:: FRIDAY
44-
45-
.. attribute:: SATURDAY
46-
47-
.. attribute:: SUNDAY
48-
49-
.. versionadded:: 3.12
50-
51-
52-
.. class:: Month
53-
54-
Enumeration defining months of the year as integer constants, from 1 to 12.
55-
56-
.. attribute:: JANUARY
57-
58-
.. attribute:: FEBRUARY
59-
60-
.. attribute:: MARCH
61-
62-
.. attribute:: APRIL
63-
64-
.. attribute:: MAY
65-
66-
.. attribute:: JUNE
67-
68-
.. attribute:: JULY
69-
70-
.. attribute:: AUGUST
71-
72-
.. attribute:: SEPTEMBER
73-
74-
.. attribute:: OCTOBER
75-
76-
.. attribute:: NOVEMBER
77-
78-
.. attribute:: DECEMBER
79-
80-
.. versionadded:: 3.12
81-
82-
8331
.. class:: Calendar(firstweekday=0)
8432

8533
Creates a :class:`Calendar` object. *firstweekday* is an integer specifying the
@@ -446,6 +394,29 @@ The :mod:`calendar` module exports the following data attributes:
446394
An array that represents the abbreviated days of the week in the current locale.
447395

448396

397+
.. data:: MONDAY
398+
TUESDAY
399+
WEDNESDAY
400+
THURSDAY
401+
FRIDAY
402+
SATURDAY
403+
SUNDAY
404+
405+
Aliases for the days of the week,
406+
where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``.
407+
408+
.. versionadded:: 3.12
409+
410+
411+
.. class:: Day
412+
413+
Enumeration defining days of the week as integer constants.
414+
The members of this enumeration are exported to the module scope as
415+
:data:`MONDAY` through :data:`SUNDAY`.
416+
417+
.. versionadded:: 3.12
418+
419+
449420
.. data:: month_name
450421

451422
An array that represents the months of the year in the current locale. This
@@ -459,15 +430,56 @@ The :mod:`calendar` module exports the following data attributes:
459430
locale. This follows normal convention of January being month number 1, so it
460431
has a length of 13 and ``month_abbr[0]`` is the empty string.
461432

462-
.. data:: MONDAY
463-
TUESDAY
464-
WEDNESDAY
465-
THURSDAY
466-
FRIDAY
467-
SATURDAY
468-
SUNDAY
469433

470-
Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``.
434+
.. data:: JANUARY
435+
FEBRUARY
436+
MARCH
437+
APRIL
438+
MAY
439+
JUNE
440+
JULY
441+
AUGUST
442+
SEPTEMBER
443+
OCTOBER
444+
NOVEMBER
445+
DECEMBER
446+
447+
Aliases for the months of the year,
448+
where ``JANUARY`` is ``1`` and ``DECEMBER`` is ``12``.
449+
450+
.. versionadded:: 3.12
451+
452+
453+
.. class:: Month
454+
455+
Enumeration defining months of the year as integer constants.
456+
The members of this enumeration are exported to the module scope as
457+
:data:`JANUARY` through :data:`DECEMBER`.
458+
459+
.. versionadded:: 3.12
460+
461+
462+
The :mod:`calendar` module defines the following exceptions:
463+
464+
.. exception:: IllegalMonthError(month)
465+
466+
A subclass of :exc:`ValueError`,
467+
raised when the given month number is outside of the range 1-12 (inclusive).
468+
469+
.. attribute:: month
470+
471+
The invalid month number.
472+
473+
474+
.. exception:: IllegalWeekdayError(weekday)
475+
476+
A subclass of :exc:`ValueError`,
477+
raised when the given weekday number is outside of the range 0-6 (inclusive).
478+
479+
.. attribute:: weekday
480+
481+
The invalid weekday number.
482+
471483

472484
.. seealso::
473485

Doc/library/dis.rst

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ interpreter.
4343
adaptive bytecode can be shown by passing ``adaptive=True``.
4444

4545

46-
Example: Given the function :func:`myfunc`::
46+
Example: Given the function :func:`!myfunc`::
4747

4848
def myfunc(alist):
4949
return len(alist)
5050

5151
the following command can be used to display the disassembly of
52-
:func:`myfunc`:
52+
:func:`!myfunc`:
5353

5454
.. doctest::
5555

@@ -297,6 +297,9 @@ operation is being performed, so the intermediate analysis object isn't useful:
297297
The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno``
298298
and ``co_lnotab`` attributes of the code object.
299299

300+
.. versionchanged:: 3.13
301+
Line numbers can be ``None`` for bytecode that does not map to source lines.
302+
300303

301304
.. function:: findlabels(code)
302305

@@ -402,7 +405,12 @@ details of bytecode instructions as :class:`Instruction` instances:
402405

403406
.. data:: starts_line
404407

405-
line started by this opcode (if any), otherwise ``None``
408+
``True`` if this opcode starts a source line, otherwise ``False``
409+
410+
411+
.. data:: line_number
412+
413+
source line number associated with this opcode (if any), otherwise ``None``
406414

407415

408416
.. data:: is_jump_target
@@ -429,8 +437,11 @@ details of bytecode instructions as :class:`Instruction` instances:
429437

430438
.. versionchanged:: 3.13
431439

440+
Changed field ``starts_line``.
441+
432442
Added fields ``start_offset``, ``cache_offset``, ``end_offset``,
433-
``baseopname``, ``baseopcode``, ``jump_target`` and ``oparg``.
443+
``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``, and
444+
``line_number``.
434445

435446

436447
.. class:: Positions
@@ -851,7 +862,7 @@ iterations of the loop.
851862

852863
.. opcode:: LOAD_BUILD_CLASS
853864

854-
Pushes :func:`builtins.__build_class__` onto the stack. It is later called
865+
Pushes :func:`!builtins.__build_class__` onto the stack. It is later called
855866
to construct a class.
856867

857868

@@ -909,14 +920,14 @@ iterations of the loop.
909920
.. opcode:: STORE_NAME (namei)
910921

911922
Implements ``name = STACK.pop()``. *namei* is the index of *name* in the attribute
912-
:attr:`co_names` of the code object. The compiler tries to use
913-
:opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible.
923+
:attr:`!co_names` of the :ref:`code object <code-objects>`.
924+
The compiler tries to use :opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible.
914925

915926

916927
.. opcode:: DELETE_NAME (namei)
917928

918-
Implements ``del name``, where *namei* is the index into :attr:`co_names`
919-
attribute of the code object.
929+
Implements ``del name``, where *namei* is the index into :attr:`!co_names`
930+
attribute of the :ref:`code object <code-objects>`.
920931

921932

922933
.. opcode:: UNPACK_SEQUENCE (count)
@@ -955,7 +966,8 @@ iterations of the loop.
955966
value = STACK.pop()
956967
obj.name = value
957968

958-
where *namei* is the index of name in :attr:`co_names`.
969+
where *namei* is the index of name in :attr:`!co_names` of the
970+
:ref:`code object <code-objects>`.
959971

960972
.. opcode:: DELETE_ATTR (namei)
961973

@@ -964,7 +976,8 @@ iterations of the loop.
964976
obj = STACK.pop()
965977
del obj.name
966978

967-
where *namei* is the index of name into :attr:`co_names`.
979+
where *namei* is the index of name into :attr:`!co_names` of the
980+
:ref:`code object <code-objects>`.
968981

969982

970983
.. opcode:: STORE_GLOBAL (namei)

Doc/library/errno.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,13 @@ defined by the module. The specific list of defined symbols is available as
511511
Operation not supported on transport endpoint
512512

513513

514+
.. data:: ENOTSUP
515+
516+
Operation not supported
517+
518+
.. versionadded:: 3.2
519+
520+
514521
.. data:: EPFNOSUPPORT
515522

516523
Protocol family not supported
@@ -666,3 +673,24 @@ defined by the module. The specific list of defined symbols is available as
666673
.. availability:: WASI, FreeBSD
667674

668675
.. versionadded:: 3.11.1
676+
677+
678+
.. data:: ECANCELED
679+
680+
Operation canceled
681+
682+
.. versionadded:: 3.2
683+
684+
685+
.. data:: EOWNERDEAD
686+
687+
Owner died
688+
689+
.. versionadded:: 3.2
690+
691+
692+
.. data:: ENOTRECOVERABLE
693+
694+
State not recoverable
695+
696+
.. versionadded:: 3.2

Doc/library/io.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,13 +1054,21 @@ Text I/O
10541054

10551055
* ``seek(0, SEEK_SET)``: Rewind to the start of the stream.
10561056
* ``seek(cookie, SEEK_SET)``: Restore a previous position;
1057-
*cookie* **must be** a number returned by :meth:`!tell`.
1057+
*cookie* **must be** a number returned by :meth:`tell`.
10581058
* ``seek(0, SEEK_END)``: Fast-forward to the end of the stream.
10591059
* ``seek(0, SEEK_CUR)``: Leave the current stream position unchanged.
10601060

10611061
Any other argument combinations are invalid,
10621062
and may raise exceptions.
10631063

1064+
.. method:: tell()
1065+
1066+
Return the stream position as an opaque number.
1067+
The return value of :meth:`!tell` can be given as input to :meth:`seek`,
1068+
to restore a previous stream position.
1069+
1070+
1071+
10641072
.. class:: StringIO(initial_value='', newline='\n')
10651073

10661074
A text stream using an in-memory text buffer. It inherits

Doc/library/logging.config.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,8 @@ resolve to ``'dev_team@domain.tld'`` and the string
685685
``'support_team@domain.tld'``. The ``subject`` value could be accessed
686686
using either ``'cfg://handlers.email.subject'`` or, equivalently,
687687
``'cfg://handlers.email[subject]'``. The latter form only needs to be
688-
used if the key contains spaces or non-alphanumeric characters. If an
688+
used if the key contains spaces or non-alphanumeric characters. Please note
689+
that the characters ``[`` and ``]`` are not allowed in the keys. If an
689690
index value consists only of decimal digits, access will be attempted
690691
using the corresponding integer value, falling back to the string
691692
value if needed.

0 commit comments

Comments
 (0)