Skip to content

Commit 2386695

Browse files
committed
Misc. fixes
1 parent 76dc942 commit 2386695

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

peps/pep-0764.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ It is possible to define a nested inlined dictionary::
100100

101101
Movie = TypedDict[{'name': str, 'production': TypedDict[{'location': str}]}]
102102

103-
# Note that the following is invalid as per the updated `type_expression` production:
103+
# Note that the following is invalid as per the updated `type_expression` grammar:
104104
Movie = TypedDict[{'name': str, 'production': {'location': str}}]
105105

106106
Although it is not possible to specify any class arguments such as ``total``,
107-
Any :external+typing:term:`type qualifier` can be used for individual fields::
107+
any :external+typing:term:`type qualifier` can be used for individual fields::
108108

109109
Movie = TypedDict[{'name': NotRequired[str], 'year': ReadOnly[int]}]
110110

@@ -134,6 +134,19 @@ are bound to some outer scope::
134134

135135
**TODO** closed
136136

137+
Typing specification changes
138+
----------------------------
139+
140+
The inlined typed dictionary adds a new kind of
141+
:term:`type expressions <typing:type expression>`. As such, the
142+
:external+typing:token:`~expression-grammar:type_expression` production will
143+
need to be updated to include the inlined syntax:
144+
145+
.. productionlist:: inlined-typed-dictionaries-grammar
146+
new-type_expression: `~expression-grammar:type_expression`
147+
: | <TypedDict> '[' '{' (string: ':' `~expression-grammar:annotation_expression` ',')* '}' ']'
148+
(where string is any string literal)
149+
137150
Runtime behavior
138151
----------------
139152

@@ -149,19 +162,6 @@ return the same type (apart from the different :attr:`~type.__name__`)::
149162
T1 = TypedDict('T1', {'a': int})
150163
T2 = TypedDict[{'a': int}]
151164

152-
Typing specification changes
153-
----------------------------
154-
155-
The inlined typed dictionary adds a new kind of
156-
:term:`type expressions <typing:type expression>`. As such, the
157-
:external+typing:token:`~expression-grammar:type_expression` production will
158-
need to be updated to include the inlined syntax:
159-
160-
.. productionlist:: inlined-typed-dictionaries-grammar
161-
new-type_expression: `~expression-grammar:type_expression`
162-
: | <TypedDict> '[' '{' (string: ':' `~expression-grammar:annotation_expression` ',')* '}' ']'
163-
(where string is any string literal)
164-
165165

166166
Backwards Compatibility
167167
=======================

0 commit comments

Comments
 (0)