8000 Python 3.10.3 · wrongnull/cpython@a342a49 · GitHub
[go: up one dir, main page]

Skip to content

Commit a342a49

Browse files
committed
Python 3.10.3
1 parent 04fdbb4 commit a342a49

File tree

95 files changed

+1048
-275
lines changed

Some content is hidden

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

95 files changed

+1048
-275
lines changed

Include/patchlevel.h

Lines changed: 2 additions & 2 deletions
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 10
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.10.2+"
26+
#define PY_VERSION "3.10.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

Lines changed: 100 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Autogenerated by Sphinx on Thu Jan 13 18:49:56 2022
2+
# Autogenerated by Sphinx on Wed Mar 16 11:26:55 2022
33
topics = {'assert': 'The "assert" statement\n'
44
'**********************\n'
55
'\n'
@@ -6233,19 +6233,19 @@
62336233
'"\'0\'" no\n'
62346234
'longer affects the default alignment for strings.\n'
62356235
'\n'
6236-
'The *precision* is a decimal number indicating how many '
6236+
'The *precision* is a decimal integer indicating how many '
62376237
'digits should\n'
6238-
'be displayed after the decimal point for a floating point '
6239-
'value\n'
6240-
'formatted with "\'f\'" and "\'F\'", or before and after the '
6241-
'decimal point\n'
6242-
'for a floating point value formatted with "\'g\'" or '
6243-
'"\'G\'". For non-\n'
6244-
'number types the field indicates the maximum field size - '
6245-
'in other\n'
6246-
'words, how many characters will be used from the field '
6247-
'content. The\n'
6248-
'*precision* is not allowed for integer values.\n'
6238+
'be displayed after the decimal point for presentation types '
6239+
'"\'f\'" and\n'
6240+
'"\'F\'", or before and after the decimal point for '
6241+
'presentation types\n'
6242+
'"\'g\'" or "\'G\'". For string presentation types the '
6243+
'field indicates the\n'
6244+
'maximum field size - in other words, how many characters '
6245+
'will be used\n'
6246+
'from the field content. The *precision* is not allowed for '
6247+
'integer\n'
6248+
'presentation types.\n'
62496249
'\n'
62506250
'Finally, the *type* determines how the data should be '
62516251
'presented.\n'
@@ -8384,12 +8384,12 @@
83848384
'\n'
83858385
' raise_stmt ::= "raise" [expression ["from" expression]]\n'
83868386
'\n'
8387-
'If no expressions are present, "raise" re-raises the last '
8388-
'exception\n'
8389-
'that was active in the current scope. If no exception is active '
8390-
'in\n'
8391-
'the current scope, a "RuntimeError" exception is raised indicating\n'
8392-
'that this is an error.\n'
8387+
'If no expressions are present, "raise" re-raises the exception that '
8388+
'is\n'
8389+
'currently being handled, which is also known as the *active\n'
8390+
'exception*. If there isn’t currently an active exception, a\n'
8391+
'"RuntimeError" exception is raised indicating that this is an '
8392+
'error.\n'
83938393
'\n'
83948394
'Otherwise, "raise" evaluates the first expression as the exception\n'
83958395
'object. It must be either a subclass or an instance of\n'
@@ -8444,11 +8444,14 @@
84448444
' File "<stdin>", line 4, in <module>\n'
84458445
' RuntimeError: Something bad happened\n'
84468446
'\n'
8447-
'A similar mechanism works implicitly if an exception is raised '
8448-
'inside\n'
8449-
'an exception handler or a "finally" clause: the previous exception '
8450-
'is\n'
8451-
'then attached as the new exception’s "__context__" attribute:\n'
8447+
'A similar mechanism works implicitly if a new exception is raised '
8448+
'when\n'
8449+
'an exception is already being handled. An exception may be '
8450+
'handled\n'
8451+
'when an "except" or "finally" clause, or a "with" statement, is '
8452+
'used.\n'
8453+
'The previous exception is then attached as the new exception’s\n'
8454+
'"__context__" attribute:\n'
84528455
'\n'
84538456
' >>> try:\n'
84548457
' ... print(1 / 0)\n'
@@ -9916,14 +9919,14 @@
99169919
'\n'
99179920
'Whenever a class inherits from another class, '
99189921
'"__init_subclass__()" is\n'
9919-
'called on that class. This way, it is possible to write '
9920-
'classes which\n'
9921-
'change the behavior of subclasses. This is closely related '
9922-
'to class\n'
9923-
'decorators, but where class decorators only affect the '
9924-
'specific class\n'
9925-
'they’re applied to, "__init_subclass__" solely applies to '
9926-
'future\n'
9922+
'called on the parent class. This way, it is possible to '
9923+
'write classes\n'
9924+
'which change the behavior of subclasses. This is closely '
9925+
'related to\n'
9926+
'class decorators, but where class decorators only affect the '
9927+
'specific\n'
9928+
'class they’re applied to, "__init_subclass__" solely applies '
9929+
'to future\n'
99279930
'subclasses of the class defining the method.\n'
99289931
'\n'
99299932
'classmethod object.__init_subclass__(cls)\n'
@@ -12290,67 +12293,86 @@
1229012293
'subscriptions': 'Subscriptions\n'
1229112294
'*************\n'
1229212295
'\n'
12293-
'Subscription of a sequence (string, tuple or list) or '
12294-
'mapping\n'
12295-
'(dictionary) object usually selects an item from the '
12296-
'collection:\n'
12296+
'The subscription of an instance of a container class will '
12297+
'generally\n'
12298+
'select an element from the container. The subscription of a '
12299+
'*generic\n'
12300+
'class* will generally return a GenericAlias object.\n'
1229712301
'\n'
1229812302
' subscription ::= primary "[" expression_list "]"\n'
1229912303
'\n'
12304+
'When an object is subscripted, the interpreter will '
12305+
'evaluate the\n'
12306+
'primary and the expression list.\n'
12307+
'\n'
1230012308
'The primary must evaluate to an object that supports '
12301-
'subscription\n'
12302-
'(lists or dictionaries for example). User-defined objects '
12303-
'can support\n'
12304-
'subscription by defining a "__getitem__()" method.\n'
12309+
'subscription. An\n'
12310+
'object may support subscription through defining one or '
12311+
'both of\n'
12312+
'"__getitem__()" and "__class_getitem__()". When the primary '
12313+
'is\n'
12314+
'subscripted, the evaluated result of the expression list '
12315+
'will be\n'
12316+
'passed to one of these methods. For more details on when\n'
12317+
'"__class_getitem__" is called instead of "__getitem__", '
12318+
'see\n'
12319+
'__class_getitem__ versus __getitem__.\n'
12320+
'\n'
12321+
'If the expression list contains at least one comma, it will '
12322+
'evaluate\n'
12323+
'to a "tuple" containing the items of the expression list. '
12324+
'Otherwise,\n'
12325+
'the expression list will evaluate to the value of the '
12326+
'list’s sole\n'
12327+
'member.\n'
1230512328
'\n'
1230612329
'For built-in objects, there are two types of objects that '
1230712330
'support\n'
12308-
'subscription:\n'
12331+
'subscription via "__getitem__()":\n'
1230912332
'\n'
12310-
'If the primary is a mapping, the expression list must '
12311-
'evaluate to an\n'
12312-
'object whose value is one of the keys of the mapping, and '
12333+
'1. Mappings. If the primary is a *mapping*, the expression '
12334+
'list must\n'
12335+
' evaluate to an object whose value is one of the keys of '
1231312336
'the\n'
12314-
'subscription selects the value in the mapping that '
12315-
'corresponds to that\n'
12316-
'key. (The expression list is a tuple except if it has '
12317-
'exactly one\n'
12318-
'item.)\n'
12319-
'\n'
12320-
'If the primary is a sequence, the expression list must '
12321-
'evaluate to an\n'
12322-
'integer or a slice (as discussed in the following '
12323-
'section).\n'
12337+
' mapping, and the subscription selects the value in the '
12338+
'mapping that\n'
12339+
' corresponds to that key. An example of a builtin mapping '
12340+
'class is\n'
12341+
' the "dict" class.\n'
12342+
'\n'
12343+
'2. Sequences. If the primary is a *sequence*, the '
12344+
'expression list must\n'
12345+
' evaluate to an "int" or a "slice" (as discussed in the '
12346+
'following\n'
12347+
' section). Examples of builtin sequence classes include '
12348+
'the "str",\n'
12349+
' "list" and "tuple" classes.\n'
1232412350
'\n'
1232512351
'The formal syntax makes no special provision for negative '
1232612352
'indices in\n'
12327-
'sequences; however, built-in sequences all provide a '
12353+
'*sequences*. However, built-in sequences all provide a '
1232812354
'"__getitem__()"\n'
1232912355
'method that interprets negative indices by adding the '
1233012356
'length of the\n'
12331-
'sequence to the index (so that "x[-1]" selects the last '
12332-
'item of "x").\n'
12333-
'The resulting value must be a nonnegative integer less than '
12334-
'the number\n'
12335-
'of items in the sequence, and the subscription selects the '
12336-
'item whose\n'
12337-
'index is that value (counting from zero). Since the support '
12338-
'for\n'
12339-
'negative indices and slicing occurs in the object’s '
12340-
'"__getitem__()"\n'
12341-
'method, subclasses overriding this method will need to '
12342-
'explicitly add\n'
12343-
'that support.\n'
12344-
'\n'
12345-
'A string’s items are characters. A character is not a '
12346-
'separate data\n'
12347-
'type but a string of exactly one character.\n'
12348-
'\n'
12349-
'Subscription of certain *classes* or *types* creates a '
12350-
'generic alias.\n'
12351-
'In this case, user-defined classes can support subscription '
12352-
'by\n'
12353-
'providing a "__class_getitem__()" classmethod.\n',
12357+
'sequence to the index so that, for example, "x[-1]" selects '
12358+
'the last\n'
12359+
'item of "x". The resulting value must be a nonnegative '
12360+
'integer less\n'
12361+
'than the number of items in the sequence, and the '
12362+
'subscription selects\n'
12363+
'the item whose index is that value (counting from zero). '
12364+
'Since the\n'
12365+
'support for negative indices and slicing occurs in the '
12366+
'object’s\n'
12367+
'"__getitem__()" method, subclasses overriding this method '
12368+
'will need to\n'
12369+
'explicitly add that support.\n'
12370+
'\n'
12371+
'A "string" is a special kind of sequence whose items are '
12372+
'*characters*.\n'
12373+
'A character is not a separate data type but a string of '
12374+
'exactly one\n'
12375+
'character.\n',
1235412376
'truth': 'Truth Value Testing\n'
1235512377
'*******************\n'
1235612378
'\n'

0 commit comments

Comments
 (0)
0