1- # Autogenerated by Sphinx on Mon May 26 16:26:41 2025
1+ # Autogenerated by Sphinx on Tue Jun 17 18:40:47 2025
22# as part of the release process.
33
44topics = {
@@ -5327,7 +5327,7 @@ class of the instance or a *non-virtual base class* thereof. The
53275327 sign: "+" | "-" | " "
53285328 width_and_precision: [width_with_grouping][precision_with_grouping]
53295329 width_with_grouping: [width][grouping]
5330- precision_with_grouping: "." [precision][grouping]
5330+ precision_with_grouping: "." [precision][grouping] | "." grouping
53315331 width: digit+
53325332 precision: digit+
53335333 grouping: "," | "_"
@@ -9303,7 +9303,13 @@ class is used in a class pattern with positional arguments, each
93039303
93049304 For performance reasons, the value of *errors* is not checked for
93059305 validity unless an encoding error actually occurs, Python
9306- Development Mode is enabled or a debug build is used.
9306+ Development Mode is enabled or a debug build is used. For example:
9307+
9308+ >>> encoded_str_to_bytes = 'Python'.encode()
9309+ >>> type(encoded_str_to_bytes)
9310+ <class 'bytes'>
9311+ >>> encoded_str_to_bytes
9312+ b'Python'
93079313
93089314 Changed in version 3.1: Added support for keyword arguments.
93099315
@@ -9316,6 +9322,19 @@ class is used in a class pattern with positional arguments, each
93169322 otherwise return "False". *suffix* can also be a tuple of suffixes
93179323 to look for. With optional *start*, test beginning at that
93189324 position. With optional *end*, stop comparing at that position.
9325+ Using *start* and *end* is equivalent to
9326+ "str[start:end].endswith(suffix)". For example:
9327+
9328+ >>> 'Python'.endswith('on')
9329+ True
9330+ >>> 'a tuple of suffixes'.endswith(('at', 'in'))
9331+ False
9332+ >>> 'a tuple of suffixes'.endswith(('at', 'es'))
9333+ True
9334+ >>> 'Python is amazing'.endswith('is', 0, 9)
9335+ True
9336+
9337+ See also "startswith()" and "removesuffix()".
93199338
93209339str.expandtabs(tabsize=8)
93219340
@@ -9331,12 +9350,15 @@ class is used in a class pattern with positional arguments, each
93319350 ("\n") or return ("\r"), it is copied and the current column is
93329351 reset to zero. Any other character is copied unchanged and the
93339352 current column is incremented by one regardless of how the
9334- character is represented when printed.
9353+ character is represented when printed. For example:
93359354
9336- >>> '01\t012\t0123\t01234'.expandtabs()
9337- '01 012 0123 01234'
9338- >>> '01\t012\t0123\t01234'.expandtabs(4)
9339- '01 012 0123 01234'
9355+ >>> '01\t012\t0123\t01234'.expandtabs()
9356+ '01 012 0123 01234'
9357+ >>> '01\t012\t0123\t01234'.expandtabs(4)
9358+ '01 012 0123 01234'
9359+ >>> print('01\t012\n0123\t01234'.expandtabs(4))
9360+ 01 012
9361+ 0123 01234
93409362
93419363str.find(sub[, start[, end]])
93429364
@@ -9924,8 +9946,9 @@ class is used in a class pattern with positional arguments, each
99249946String literals are described by the following lexical definitions:
99259947
99269948 stringliteral: [stringprefix](shortstring | longstring)
9927- stringprefix: "r" | "u" | "R" | "U" | "f" | "F"
9949+ stringprefix: "r" | "u" | "R" | "U" | "f" | "F" | "t" | "T"
99289950 | "fr" | "Fr" | "fR" | "FR" | "rf" | "rF" | "Rf" | "RF"
9951+ | "tr" | "Tr" | "tR" | "TR" | "rt" | "rT" | "Rt" | "RT"
99299952 shortstring: "'" shortstringitem* "'" | '"' shortstringitem* '"'
99309953 longstring: "\'\'\'" longstringitem* "\'\'\'" | '"""' longstringitem* '"""'
99319954 shortstringitem: shortstringchar | stringescapeseq
@@ -11242,11 +11265,20 @@ class method object, it is transformed into an instance method object
1124211265| | collected during class body execution. See also: |
1124311266| | "__annotations__ attributes". For best practices |
1124411267| | on working with "__annotations__", please see |
11245- | | "annotationlib". Where possible, use |
11268+ | | "annotationlib". Use |
1124611269| | "annotationlib.get_annotations()" instead of |
11247- | | accessing this attribute directly. Changed in |
11248- | | version 3.14: Annotations are now lazily |
11249- | | evaluated. See **PEP 649**. |
11270+ | | accessing this attribute directly. Warning: |
11271+ | | Accessing the "__annotations__" attribute directly |
11272+ | | on a class object may return annotations for the |
11273+ | | wrong class, specifically in certain cases where |
11274+ | | the class, its base class, or a metaclass is |
11275+ | | defined under "from __future__ import |
11276+ | | annotations". See **749** for details.This |
11277+ | | attribute does not exist on certain builtin |
11278+ | | classes. On user-defined classes without |
11279+ | | "__annotations__", it is an empty dictionary. |
11280+ | | Changed in version 3.14: Annotations are now |
11281+ | | lazily evaluated. See **PEP 649**. |
1125011282+----------------------------------------------------+----------------------------------------------------+
1125111283| type.__annotate__() | The *annotate function* for this class, or "None" |
1125211284| | if the class has no annotations. See also: |
@@ -12240,7 +12272,7 @@ class dict(iterable, **kwargs)
1224012272| "s * n" or "n * s" | equivalent to adding *s* to | (2)(7) |
1224112273| | itself *n* times | |
1224212274+----------------------------+----------------------------------+------------+
12243- | "s[i]" | *i*th item of *s*, origin 0 | (3) |
12275+ | "s[i]" | *i*th item of *s*, origin 0 | (3)(9) |
1224412276+----------------------------+----------------------------------+------------+
1224512277| "s[i:j]" | slice of *s* from *i* to *j* | (3)(4) |
1224612278+----------------------------+----------------------------------+------------+
@@ -12364,6 +12396,8 @@ class dict(iterable, **kwargs)
1236412396 returned index being relative to the start of the sequence rather
1236512397 than the start of the slice.
1236612398
12399+ 9. An "IndexError" is raised if *i* is outside the sequence range.
12400+
1236712401
1236812402Immutable Sequence Types
1236912403========================
@@ -12398,6 +12432,8 @@ class dict(iterable, **kwargs)
1239812432| "s[i] = x" | item *i* of *s* is replaced by | |
1239912433| | *x* | |
1240012434+--------------------------------+----------------------------------+-----------------------+
12435+ | "del s[i]" | removes item *i* of *s* | |
12436+ +--------------------------------+----------------------------------+-----------------------+
1240112437| "s[i:j] = t" | slice of *s* from *i* to *j* is | |
1240212438| | replaced by the contents of the | |
1240312439| | iterable *t* | |
@@ -12726,6 +12762,8 @@ class range(start, stop[, step])
1272612762| "s[i] = x" | item *i* of *s* is replaced by | |
1272712763| | *x* | |
1272812764+--------------------------------+----------------------------------+-----------------------+
12765+ | "del s[i]" | removes item *i* of *s* | |
12766+ +--------------------------------+----------------------------------+-----------------------+
1272912767| "s[i:j] = t" | slice of *s* from *i* to *j* is | |
1273012768| | replaced by the contents of the | |
1273112769| | iterable *t* | |
0 commit comments