You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec-draft.rst
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ as (we are omiting the ``Literal`` in places)::
60
60
61
61
62
62
Rationale
63
-
^^^^^^^^^
63
+
'''''''''
64
64
We need extended callable support, in order to inspect and produce callables via type-level computation. mypy supports `extended callables <https://mypy.readthedocs.io/en/stable/additional_features.html#extended-callable-types>`__ but they are deprecated in favor of callback protocols.
65
65
66
66
@@ -134,7 +134,7 @@ Type operators
134
134
135
135
136
136
Object inspection and creation
137
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
137
+
''''''''''''''''''''''''''''''
138
138
139
139
* ``NewProtocol[*Ps: Member]``
140
140
@@ -166,7 +166,7 @@ We also have helpers for extracting those names; they are all definable in terms
166
166
167
167
168
168
Callable inspection and creation
169
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
169
+
''''''''''''''''''''''''''''''''
170
170
171
171
``Callable`` types always have their arguments exposed in the extended Callable format discussed above.
172
172
@@ -180,7 +180,7 @@ TODO: Should we make ``GetInit`` be literal types of default parameter values to
180
180
* ``Length[T: tuple]`` - get the length of a tuple as an int literal (or ``Literal[None]`` if it is unbounded)
181
181
182
182
Annotated
183
-
^^^^^^^^^
183
+
'''''''''
184
184
185
185
Libraries like FastAPI use annotations heavily, and we would like to be able to use annotations to drive type-level computation decision making.
186
186
@@ -201,7 +201,7 @@ We understand that this may be controversial, as currently Annotated may be full
201
201
202
202
203
203
InitField
204
-
^^^^^^^^^
204
+
'''''''''
205
205
206
206
We want to be able to support transforming types based on dataclasses/attrs/pydantic style field descriptors. In order to do that, we need to be able to consume things like calls to ``Field``.
207
207
@@ -224,7 +224,7 @@ So if we write::
224
224
then we would infer the type ``InitField[TypedDict('...', {'default': Literal[0]})]`` for the initializer, and that would be made available as the ``Init`` field of the ``Member``.
225
225
226
226
String manipulation
227
-
^^^^^^^^^^^^^^^^^^^
227
+
'''''''''''''''''''
228
228
229
229
String manipulation operations for string Literal types.
230
230
We can put more in, but this is what typescript has.
0 commit comments