8000 Python 3.13.3 · python/cpython@6280bb5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6280bb5

Browse files
committed
Python 3.13.3
1 parent 67c7de4 commit 6280bb5

File tree

108 files changed

+1119
-240
lines changed

Some content is hidden

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

108 files changed

+1119
-240
lines changed

Doc/c-api/monitoring.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,6 @@ would typically correspond to a python function.
199199
200200
.. versionadded:: 3.13
201201
202-
.. deprecated:: next
202+
.. deprecated:: 3.13.3
203203
204204
This function is :term:`soft deprecated`.

Include/patchlevel.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
/*--start constants--*/
1919
#define PY_MAJOR_VERSION 3
2020
#define PY_MINOR_VERSION 13
21-
#define PY_MICRO_VERSION 2
21+
#define PY_MICRO_VERSION 3
2222
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
2323
#define PY_RELEASE_SERIAL 0
2424

2525
/* Version as a string */
26-
#define PY_VERSION "3.13.2+"
26+
#define PY_VERSION "3.13.3"
2727
/*--end constants--*/
2828

2929
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.

Lib/pydoc_data/topics.py

+73-47
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Autogenerated by Sphinx on Sat Feb 22 02:02:02 2025
1+
# Autogenerated by Sphinx on Tue Apr 8 15:54:03 2025
22
# as part of the release process.
33

44
topics = {
@@ -2689,7 +2689,7 @@ class attributes; they are shared by instances. Instance attributes
26892689
parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
26902690
| parameter_list_starargs
26912691
parameter_list_starargs ::= "*" [star_parameter] ("," defparameter)* ["," [parameter_star_kwargs]]
2692-
"*" ("," defparameter)+ ["," [parameter_star_kwargs]]
2692+
| "*" ("," defparameter)+ ["," [parameter_star_kwargs]]
26932693
| parameter_star_kwargs
26942694
parameter_star_kwargs ::= "**" parameter [","]
26952695
parameter ::= identifier [":" expression]
@@ -3787,7 +3787,7 @@ def double(x):
37873787
You can also invoke "pdb" from the command line to debug other
37883788
scripts. For example:
37893789

3790-
python -m pdb myscript.py
3790+
python -m pdb [-c command] (-m module | pyfile) [args ...]
37913791

37923792
When invoked as a module, pdb will automatically enter post-mortem
37933793
debugging if the program being debugged exits abnormally. After post-
@@ -3796,12 +3796,20 @@ def double(x):
37963796
as breakpoints) and in most cases is more useful than quitting the
37973797
debugger upon program’s exit.
37983798

3799-
Changed in version 3.2: Added the "-c" option to execute commands as
3800-
if given in a ".pdbrc" file; see Debugger Commands.
3799+
-c, --command <command>
38013800

3802-
Changed in version 3.7: Added the "-m" option to execute modules
3803-
similar to the way "python -m" does. As with a script, the debugger
3804-
will pause execution just before the first line of the module.
3801+
To execute commands as if given in a ".pdbrc" file; see Debugger
3802+
Commands.
3803+
3804+
Changed in version 3.2: Added the "-c" option.
3805+
3806+
-m <module>
3807+
3808+
To execute modules similar to the way "python -m" does. As with a
3809+
script, the debugger will pause execution just before the first
3810+
line of the module.
3811+
3812+
Changed in version 3.7: Added the "-m" option.
38053813

38063814
Typical usage to execute a statement under control of the debugger is:
38073815

@@ -5153,14 +5161,16 @@ class of the instance or a *non-virtual base class* thereof. The
51535161

51545162
The general form of a *standard format specifier* is:
51555163

5156-
format_spec ::= [[fill]align][sign]["z"]["#"]["0"][width][grouping_option]["." precision][type]
5157-
fill ::= <any character>
5158-
align ::= "<" | ">" | "=" | "^"
5159-
sign ::= "+" | "-" | " "
5160-
width ::= digit+
5161-
grouping_option ::= "_" | ","
5162-
precision ::= digit+
5163-
type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
5164+
format_spec ::= [options][width][grouping]["." precision][type]
5165+
options ::= [[fill]align][sign]["z"]["#"]["0"]
5166+
fill ::= <any character>
5167+
align ::= "<" | ">" | "=" | "^"
5168+
sign ::= "+" | "-" | " "
5169+
width ::= digit+
5170+
grouping ::= "," | "_"
5171+
precision ::= digit+
5172+
type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g"
5173+
| "G" | "n" | "o" | "s" | "x" | "X" | "%"
51645174

51655175
If a valid *align* value is specified, it can be preceded by a *fill*
51665176
character that can be any character and defaults to a space if
@@ -5202,13 +5212,13 @@ class of the instance or a *non-virtual base class* thereof. The
52025212
+-----------+------------------------------------------------------------+
52035213
| Option | Meaning |
52045214
|===========|============================================================|
5205-
| "'+'" | indicates that a sign should be used for both positive as |
5215+
| "'+'" | Indicates that a sign should be used for both positive as |
52065216
| | well as negative numbers. |
52075217
+-----------+------------------------------------------------------------+
5208-
| "'-'" | indicates that a sign should be used only for negative |
5218+
| "'-'" | Indicates that a sign should be used only for negative |
52095219
| | numbers (this is the default behavior). |
52105220
+-----------+------------------------------------------------------------+
5211-
| space | indicates that a leading space should be used on positive |
5221+
| space | Indicates that a leading space should be used on positive |
52125222
| | numbers, and a minus sign on negative numbers. |
52135223
+-----------+------------------------------------------------------------+
52145224

@@ -5231,26 +5241,10 @@ class of the instance or a *non-virtual base class* thereof. The
52315241
digit follows it. In addition, for "'g'" and "'G'" conversions,
52325242
trailing zeros are not removed from the result.
52335243

5234-
The "','" option signals the use of a comma for a thousands separator
5235-
for floating-point presentation types and for integer presentation
5236-
type "'d'". For other presentation types, this option is an error. For
5237-
a locale aware separator, use the "'n'" integer presentation type
5238-
instead.
5239-
5240-
Changed in version 3.1: Added the "','" option (see also **PEP 378**).
5241-
5242-
The "'_'" option signals the use of an underscore for a thousands
5243-
separator for floating-point presentation types and for integer
5244-
presentation type "'d'". For integer presentation types "'b'", "'o'",
5245-
"'x'", and "'X'", underscores will be inserted every 4 digits. For
5246-
other presentation types, specifying this option is an 10000 error.
5247-
5248-
Changed in version 3.6: Added the "'_'" option (see also **PEP 515**).
5249-
5250-
*width* is a decimal integer defining the minimum total field width,
5251-
including any prefixes, separators, and other formatting characters.
5252-
If not specified, then the field width will be determined by the
5253-
content.
5244+
The *width* is a decimal integer defining the minimum total field
5245+
width, including any prefixes, separators, and other formatting
5246+
characters. If not specified, then the field width will be determined
5247+
by the content.
52545248

52555249
When no explicit alignment is given, preceding the *width* field by a
52565250
zero ("'0'") character enables sign-aware zero-padding for numeric
@@ -5260,6 +5254,32 @@ class of the instance or a *non-virtual base class* thereof. The
52605254
Changed in version 3.10: Preceding the *width* field by "'0'" no
52615255
longer affects the default alignment for strings.
52625256

5257+
The *grouping* option after the *width* field specifies a digit group
5258+
separator for the integral part of a number. It can be one of the
5259+
following:
5260+
5261+
+-----------+------------------------------------------------------------+
5262+
| Option | Meaning |
5263+
|===========|============================================================|
5264+
| "','" | Inserts a comma every 3 digits for integer presentation |
5265+
| | type "'d'" and floating-point presentation types, |
5266+
| | excluding "'n'". For other presentation types, this option |
5267+
| | is not supported. |
5268+
+-----------+------------------------------------------------------------+
5269+
| "'_'" | Inserts an underscore every 3 digits for integer |
5270+
| | presentation type "'d'" and floating-point presentation |
5271+
| | types, excluding "'n'". For integer presentation types |
5272+
| | "'b'", "'o'", "'x'", and "'X'", underscores are inserted |
5273+
| | every 4 digits. For other presentation types, this option |
5274+
| | is not supported. |
5275+
+-----------+------------------------------------------------------------+
5276+
5277+
For a locale aware separator, use the "'n'" presentation type instead.
5278+
5279+
Changed in version 3.1: Added the "','" option (see also **PEP 378**).
5280+
5281+
Changed in version 3.6: Added the "'_'" option (see also **PEP 515**).
5282+
52635283
The *precision* is a decimal integer indicating how many digits should
52645284
be displayed after the decimal point for presentation types "'f'" and
52655285
"'F'", or before and after the decimal point for presentation types
@@ -5304,8 +5324,8 @@ class of the instance or a *non-virtual base class* thereof. The
53045324
| | as well. |
53055325
+-----------+------------------------------------------------------------+
53065326
| "'n'" | Number. This is the same as "'d'", except that it uses the |
5307-
| | current locale setting to insert the appropriate number |
5308-
| | separator characters. |
5327+
| | current locale setting to insert the appropriate digit |
5328+
| | group separators. |
53095329
+-----------+------------------------------------------------------------+
53105330
| None | The same as "'d'". |
53115331
+-----------+------------------------------------------------------------+
@@ -5376,8 +5396,8 @@ class of the instance or a *non-virtual base class* thereof. The
53765396
| | and NaN are uppercased, too. |
53775397
+-----------+------------------------------------------------------------+
53785398
| "'n'" | Number. This is the same as "'g'", except that it uses the |
5379-
| | current locale setting to insert the appropriate number |
5380-
| | separator characters. |
5399+
| | current locale setting to insert the appropriate digit |
5400+
| | group separators for the integral part of a number. |
53815401
+-----------+------------------------------------------------------------+
53825402
| "'%'" | Percentage. Multiplies the number by 100 and displays in |
53835403
| | fixed ("'f'") format, followed by a percent sign. |
@@ -5500,10 +5520,16 @@ class of the instance or a *non-virtual base class* thereof. The
55005520
>>> "int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}".format(42)
55015521
'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'
55025522

5503-
Using the comma as a thousands separator:
5523+
Using the comma or the underscore as a digit group separator:
55045524

55055525
>>> '{:,}'.format(1234567890)
55065526
'1,234,567,890'
5527+
>>> '{:_}'.format(1234567890)
5528+
'1_234_567_890'
5529+
>>> '{:_b}'.format(1234567890)
5530+
'100_1001_1001_0110_0000_0010_1101_0010'
5531+
>>> '{:_x}'.format(1234567890)
5532+
'4996_02d2'
55075533

55085534
Expressing a percentage:
55095535

@@ -5563,7 +5589,7 @@ class of the instance or a *non-virtual base class* thereof. The
55635589
parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
55645590
| parameter_list_starargs
55655591
parameter_list_starargs ::= "*" [star_parameter] ("," defparameter)* ["," [parameter_star_kwargs]]
5566-
"*" ("," defparameter)+ ["," [parameter_star_kwargs]]
5592+
| "*" ("," defparameter)+ ["," [parameter_star_kwargs]]
55675593
| parameter_star_kwargs
55685594
parameter_star_kwargs ::= "**" parameter [","]
55695595
parameter ::= identifier [":" expression]
@@ -11567,7 +11593,7 @@ class dict(iterable, **kwargs)
1156711593
to be a mutable object such as an empty list. To get distinct
1156811594
values, use a dict comprehension instead.
1156911595

11570-
get(key, default=None)
11596+
get(key, default=None, /)
1157111597

1157211598
Return the value for *key* if *key* is in the dictionary, else
1157311599
*default*. If *default* is not given, it defaults to "None", so
@@ -11608,7 +11634,7 @@ class dict(iterable, **kwargs)
1160811634

1160911635
Added in version 3.8.
1161011636

11611-
setdefault(key, default=None)
11637+
setdefault(key, default=None, /)
1161211638

1161311639
If *key* is in the dictionary, return its value. If not, insert
1161411640
*key* with a value of *default* and return *default*. *default*

0 commit comments

Comments
 (0)
0