1
- # Autogenerated by Sphinx onSat Feb 22 02:02:02 2025
1
+ # Autogenerated by Sphinx onTue Apr 8 13:35:42 2025
2
2
# as part of the release process.
3
3
4
4
topics = {
@@ -2660,7 +2660,7 @@ class attributes; they are shared by instances. Instance attributes
2660
2660
parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
2661
2661
| parameter_list_starargs
2662
2662
parameter_list_starargs ::= "*" [star_parameter] ("," defparameter)* ["," [parameter_star_kwargs]]
2663
- "*" ("," defparameter)+ ["," [parameter_star_kwargs]]
2663
+ | "*" ("," defparameter)+ ["," [parameter_star_kwargs]]
2664
2664
| parameter_star_kwargs
2665
2665
parameter_star_kwargs ::= "**" parameter [","]
2666
2666
parameter ::= identifier [":" expression]
@@ -3743,7 +3743,7 @@ def double(x):
3743
3743
You can also invoke "pdb" from the command line to debug other
3744
3744
scripts. For example:
3745
3745
3746
- python -m pdbmyscript.py
3746
+ python -m pdb[-c command] (-m module | pyfile) [args ...]
3747
3747
3748
3748
When invoked as a module, pdb will automatically enter post-mortem
3749
3749
debugging if the program being debugged exits abnormally. After post-
@@ -3752,12 +3752,20 @@ def double(x):
3752
3752
as breakpoints) and in most cases is more useful than quitting the
3753
3753
debugger upon program’s exit.
3754
3754
3755
- Changed in version 3.2: Added the "-c" option to execute commands as
3756
- if given in a ".pdbrc" file; see Debugger Commands.
3755
+ -c, --command <command>
3757
3756
3758
- Changed in version 3.7: Added the "-m" option to execute modules
3759
- similar to the way "python -m" does. As with a script, the debugger
3760
- will pause execution just before the first line of the module.
3757
+ To execute commands as if given in a ".pdbrc" file; see Debugger
3758
+ Commands.
3759
+
3760
+ Changed in version 3.2: Added the "-c" option.
3761
+
3762
+ -m <module>
3763
+
3764
+ To execute modules similar to the way "python -m" does. As with a
3765
+ script, the debugger will pause execution just before the first
3766
+ line of the module.
3767
+
3768
+ Changed in version 3.7: Added the "-m" option.
3761
3769
3762
3770
Typical usage to execute a statement under control of the debugger is:
3763
3771
@@ -5026,14 +5034,16 @@ class of the instance or a *non-virtual base class* thereof. The
5026
5034
5027
5035
The general form of a *standard format specifier* is:
5028
5036
5029
- format_spec ::= [[fill]align][sign]["z"]["#"]["0"][width][grouping_option]["." precision][type]
5030
- fill ::= <any character>
5031
- align ::= "<" | ">" | "=" | "^"
5032
- sign ::= "+" | "-" | " "
5033
- width ::= digit+
5034
- grouping_option ::= "_" | ","
5035
- precision ::= digit+
5036
- type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
5037
+ format_spec ::= [options][width][grouping]["." precision][type]
5038
+ options ::= [[fill]align][sign]["z"]["#"]["0"]
5039
+ fill ::= <any character>
5040
+ align ::= "<" | ">" | "=" | "^"
5041
+ sign ::= "+" | "-" | " "
5042
+ width ::= digit+
5043
+ grouping ::= "," | "_"
5044
+ precision ::= digit+
5045
+ type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g"
5046
+ | "G" | "n" | "o" | "s" | "x" | "X" | "%"
5037
5047
5038
5048
If a valid *align* value is specified, it can be preceded by a *fill*
5039
5049
character that can be any character and defaults to a space if
@@ -5075,13 +5085,13 @@ class of the instance or a *non-virtual base class* thereof. The
5075
5085
+-----------+------------------------------------------------------------+
5076
5086
| Option | Meaning |
5077
5087
|===========|============================================================|
5078
- | "'+'" |indicates that a sign should be used for both positive as |
5088
+ | "'+'" |Indicates that a sign should be used for both positive as |
5079
5089
| | well as negative numbers. |
5080
5090
+-----------+------------------------------------------------------------+
5081
- | "'-'" |indicates that a sign should be used only for negative |
5091
+ | "'-'" |Indicates that a sign should be used only for negative |
5082
5092
| | numbers (this is the default behavior). |
5083
5093
+-----------+------------------------------------------------------------+
5084
- | space |indicates that a leading space should be used on positive |
5094
+ | space |Indicates that a leading space should be used on positive |
5085
5095
| | numbers, and a minus sign on negative numbers. |
5086
5096
+-----------+------------------------------------------------------------+
5087
5097
@@ -5104,26 +5114,10 @@ class of the instance or a *non-virtual base class* thereof. The
5104
5114
digit follows it. In addition, for "'g'" and "'G'" conversions,
5105
5115
trailing zeros are not removed from the result.
5106
5116
5107
- The "','" option signals the use of a comma for a thousands separator
5108
- for floating-point presentation types and for integer presentation
5109
- type "'d'". For other presentation types, this option is an error. For
5110
- a locale aware separator, use the "'n'" integer presentation type
5111
- instead.
5112
-
5113
- Changed in version 3.1: Added the "','" option (see also **PEP 378**).
5114
-
5115
- The "'_'" option signals the use of an underscore for a thousands
5116
- separator for floating-point presentation types and for integer
5117
- presentation type "'d'". For integer presentation types "'b'", "'o'",
5118
- "'x'", and "'X'", underscores will be inserted every 4 digits. For
5119
- other presentation types, specifying this option is an error.
5120
-
5121
- Changed in version 3.6: Added the "'_'" option (see also **PEP 515**).
5122
-
5123
- *width* is a decimal integer defining the minimum total field width,
5124
- including any prefixes, separators, and other formatting characters.
5125
- If not specified, then the field width will be determined by the
5126
- content.
5117
+ The *width* is a decimal integer defining the minimum total field
5118
+ width, including any prefixes, separators, and other formatting
5119
+ characters. If not specified, then the field width will be determined
5120
+ by the content.
5127
5121
5128
5122
When no explicit alignment is given, preceding the *width* field by a
5129
5123
zero ("'0'") character enables sign-aware zero-padding for numeric
@@ -5133,6 +5127,32 @@ class of the instance or a *non-virtual base class* thereof. The
5133
5127
Changed in version 3.10: Preceding the *width* field by "'0'" no
5134
5128
longer affects the default alignment for strings.
5135
5129
5130
+ The *grouping* option after the *width* field specifies a digit group
5131
+ separator for the integral part of a number. It can be one of the
5132
+ following:
5133
+
5134
+ +-----------+------------------------------------------------------------+
5135
+ | Option | Meaning |
5136
+ |===========|============================================================|
5137
+ | "','" | Inserts a comma every 3 digits for integer presentation |
5138
+ | | type "'d'" and floating-point presentation types, |
5139
+ | | excluding "'n'". For other presentation types, this option |
5140
+ | | is not supported. |
5141
+ +-----------+------------------------------------------------------------+
5142
+ | "'_'" | Inserts an underscore every 3 digits for integer |
5143
+ | | presentation type "'d'" and floating-point presentation |
5144
+ | | types, excluding "'n'". For integer presentation types |
5145
+ | | "'b'", "'o'", "'x'", and "'X'", underscores are inserted |
5146
+ | | every 4 digits. For other presentation types, this option |
5147
+ | | is not supported. |
5148
+ +-----------+------------------------------------------------------------+
5149
+
5150
+ For a locale aware separator, use the "'n'" presentation type instead.
5151
+
5152
+ Changed in version 3.1: Added the "','" option (see also **PEP 378**).
5153
+
5154
+ Changed in version 3.6: Added the "'_'" option (see also **PEP 515**).
5155
+
5136
5156
The *precision* is a decimal integer indicating how many digits should
5137
5157
be displayed after the decimal point for presentation types "'f'" and
5138
5158
"'F'", or before and after the decimal point for presentation types
@@ -5177,8 +5197,8 @@ class of the instance or a *non-virtual base class* thereof. The
5177
5197
| | as well. |
5178
5198
+-----------+------------------------------------------------------------+
5179
5199
| "'n'" | Number. This is the same as "'d'", except that it uses the |
5180
- | | current locale setting to insert the appropriatenumber |
5181
- | |separator characters. |
5200
+ | | current locale setting to insert the appropriatedigit |
5201
+ | |group separators. |
5182
5202
+-----------+------------------------------------------------------------+
5183
5203
| None | The same as "'d'". |
5184
5204
+-----------+------------------------------------------------------------+
@@ -5249,8 +5269,8 @@ class of the instance or a *non-virtual base class* thereof. The
5249
5269
| | and NaN are uppercased, too. |
5250
5270
+-----------+------------------------------------------------------------+
5251
5271
| "'n'" | Number. This is the same as "'g'", except that it uses the |
5252
- | | current locale setting to insert the appropriatenumber |
5253
- | |separator characters. |
5272
+ | | current locale setting to insert the appropriatedigit |
5273
+ | |group separators for the integral part of a number. |
5254
5274
+-----------+------------------------------------------------------------+
5255
5275
| "'%'" | Percentage. Multiplies the number by 100 and displays in |
5256
5276
| | fixed ("'f'") format, followed by a percent sign. |
@@ -5373,10 +5393,16 @@ class of the instance or a *non-virtual base class* thereof. The
5373
5393
>>> "int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}".format(42)
5374
5394
'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'
5375
5395
5376
- Using the comma as athousands separator:
5396
+ Using the commaor the underscore as adigit group separator:
5377
5397
5378
5398
>>> '{:,}'.format(1234567890)
5379
5399
'1,234,567,890'
5400
+ >>> '{:_}'.format(1234567890)
5401
+ '1_234_567_890'
5402
+ >>> '{:_b}'.format(1234567890)
5403
+ '100_1001_1001_0110_0000_0010_1101_0010'
5404
+ >>> '{:_x}'.format(1234567890)
5405
+ '4996_02d2'
5380
5406
5381
5407
Expressing a percentage:
5382
5408
@@ -5436,7 +5462,7 @@ class of the instance or a *non-virtual base class* thereof. The
5436
5462
parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
5437
5463
| parameter_list_starargs
5438
5464
parameter_list_starargs ::= "*" [star_parameter] ("," defparameter)* ["," [parameter_star_kwargs]]
5439
- "*" ("," defparameter)+ ["," [parameter_star_kwargs]]
5465
+ | "*" ("," defparameter)+ ["," [parameter_star_kwargs]]
5440
5466
| parameter_star_kwargs
5441
5467
parameter_star_kwargs ::= "**" parameter [","]
5442
5468
parameter ::= identifier [":" expression]
@@ -11397,7 +11423,7 @@ class dict(iterable, **kwargs)
11397
11423
to be a mutable object such as an empty list. To get distinct
11398
11424
values, use a dict comprehension instead.
11399
11425
11400
- get(key, default=None)
11426
+ get(key, default=None, / )
11401
11427
11402
11428
Return the value for *key* if *key* is in the dictionary, else
11403
11429
*default*. If *default* is not given, it defaults to "None", so
@@ -11438,7 +11464,7 @@ class dict(iterable, **kwargs)
11438
11464
11439
11465
Added in version 3.8.
11440
11466
11441
- setdefault(key, default=None)
11467
+ setdefault(key, default=None, / )
11442
11468
11443
11469
If *key* is in the dictionary, return its value. If not, insert
11444
11470
*key* with a value of *default* and return *default*. *default*