1
- # Autogenerated by Sphinx on Sat Feb 22 02:02:02 2025
1
+ # Autogenerated by Sphinx on Tue Apr 8 15:54:03 2025
2
2
# as part of the release process.
3
3
4
4
topics = {
@@ -2689,7 +2689,7 @@ class attributes; they are shared by instances. Instance attributes
2689
2689
parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
2690
2690
| parameter_list_starargs
2691
2691
parameter_list_starargs ::= "*" [star_parameter] ("," defparameter)* ["," [parameter_star_kwargs]]
2692
- "*" ("," defparameter)+ ["," [parameter_star_kwargs]]
2692
+ | "*" ("," defparameter)+ ["," [parameter_star_kwargs]]
2693
2693
| parameter_star_kwargs
2694
2694
parameter_star_kwargs ::= "**" parameter [","]
2695
2695
parameter ::= identifier [":" expression]
@@ -3787,7 +3787,7 @@ def double(x):
3787
3787
You can also invoke "pdb" from the command line to debug other
3788
3788
scripts. For example:
3789
3789
3790
- python -m pdb myscript.py
3790
+ python -m pdb [-c command] (-m module | pyfile) [args ...]
3791
3791
3792
3792
When invoked as a module, pdb will automatically enter post-mortem
3793
3793
debugging if the program being debugged exits abnormally. After post-
@@ -3796,12 +3796,20 @@ def double(x):
3796
3796
as breakpoints) and in most cases is more useful than quitting the
3797
3797
debugger upon program’s exit.
3798
3798
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>
3801
3800
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.
3805
3813
3806
3814
Typical usage to execute a statement under control of the debugger is:
3807
3815
@@ -5153,14 +5161,16 @@ class of the instance or a *non-virtual base class* thereof. The
5153
5161
5154
5162
The general form of a *standard format specifier* is:
5155
5163
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" | "%"
5164
5174
5165
5175
If a valid *align* value is specified, it can be preceded by a *fill*
5166
5176
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
5202
5212
+-----------+------------------------------------------------------------+
5203
5213
| Option | Meaning |
5204
5214
|===========|============================================================|
5205
- | "'+'" | indicates that a sign should be used for both positive as |
5215
+ | "'+'" | Indicates that a sign should be used for both positive as |
5206
5216
| | well as negative numbers. |
5207
5217
+-----------+------------------------------------------------------------+
5208
- | "'-'" | indicates that a sign should be used only for negative |
5218
+ | "'-'" | Indicates that a sign should be used only for negative |
5209
5219
| | numbers (this is the default behavior). |
5210
5220
+-----------+------------------------------------------------------------+
5211
- | space | indicates that a leading space should be used on positive |
5221
+ | space | Indicates that a leading space should be used on positive |
5212
5222
| | numbers, and a minus sign on negative numbers. |
5213
5223
+-----------+------------------------------------------------------------+
5214
5224
@@ -5231,26 +5241,10 @@ class of the instance or a *non-virtual base class* thereof. The
5231
5241
digit follows it. In addition, for "'g'" and "'G'" conversions,
5232
5242
trailing zeros are not removed from the result.
5233
5243
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.
5254
5248
5255
5249
When no explicit alignment is given, preceding the *width* field by a
5256
5250
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
5260
5254
Changed in version 3.10: Preceding the *width* field by "'0'" no
5261
5255
longer affects the default alignment for strings.
5262
5256
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
+
5263
5283
The *precision* is a decimal integer indicating how many digits should
5264
5284
be displayed after the decimal point for presentation types "'f'" and
5265
5285
"'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
5304
5324
| | as well. |
5305
5325
+-----------+------------------------------------------------------------+
5306
5326
| "'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. |
5309
5329
+-----------+------------------------------------------------------------+
5310
5330
| None | The same as "'d'". |
5311
5331
+-----------+------------------------------------------------------------+
@@ -5376,8 +5396,8 @@ class of the instance or a *non-virtual base class* thereof. The
5376
5396
| | and NaN are uppercased, too. |
5377
5397
+-----------+------------------------------------------------------------+
5378
5398
| "'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. |
5381
5401
+-----------+------------------------------------------------------------+
5382
5402
| "'%'" | Percentage. Multiplies the number by 100 and displays in |
5383
5403
| | fixed ("'f'") format, followed by a percent sign. |
@@ -5500,10 +5520,16 @@ class of the instance or a *non-virtual base class* thereof. The
5500
5520
>>> "int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}".format(42)
5501
5521
'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'
5502
5522
5503
- Using the comma as a thousands separator:
5523
+ Using the comma or the underscore as a digit group separator:
5504
5524
5505
5525
>>> '{:,}'.format(1234567890)
5506
5526
'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'
5507
5533
5508
5534
Expressing a percentage:
5509
5535
@@ -5563,7 +5589,7 @@ class of the instance or a *non-virtual base class* thereof. The
5563
5589
parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
5564
5590
| parameter_list_starargs
5565
5591
parameter_list_starargs ::= "*" [star_parameter] ("," defparameter)* ["," [parameter_star_kwargs]]
5566
- "*" ("," defparameter)+ ["," [parameter_star_kwargs]]
5592
+ | "*" ("," defparameter)+ ["," [parameter_star_kwargs]]
5567
5593
| parameter_star_kwargs
5568
5594
parameter_star_kwargs ::= "**" parameter [","]
5569
5595
parameter ::= identifier [":" expression]
@@ -11567,7 +11593,7 @@ class dict(iterable, **kwargs)
11567
11593
to be a mutable object such as an empty list. To get distinct
11568
11594
values, use a dict comprehension instead.
11569
11595
11570
- get(key, default=None)
11596
+ get(key, default=None, / )
11571
11597
11572
11598
Return the value for *key* if *key* is in the dictionary, else
11573
11599
*default*. If *default* is not given, it defaults to "None", so
@@ -11608,7 +11634,7 @@ class dict(iterable, **kwargs)
11608
11634
11609
11635
Added in version 3.8.
11610
11636
11611
- setdefault(key, default=None)
11637
+ setdefault(key, default=None, / )
11612
11638
11613
11639
If *key* is in the dictionary, return its value. If not, insert
11614
11640
*key* with a value of *default* and return *default*. *default*
0 commit comments