@@ -26,7 +26,7 @@ an overly-wide type like ``object``, which makes some use cases impossible and
26
26
generally reduces type safety. This PEP addresses this limitation by
27
27
introducing a new special form ``typing.TypeForm ``.
28
28
29
- This PEP makes no changes to the Python grammar. ``TypeForm `` is
29
+ This PEP makes no changes to the Python grammar. Correct usage of ``TypeForm `` is
30
30
intended to be enforced only by type checkers, not by the Python runtime.
31
31
32
32
@@ -95,13 +95,10 @@ would benefit from ``TypeForm``:
95
95
- Assignability checkers:
96
96
97
97
- Determines whether a value is assignable to a specified type
98
- - Pattern 1:
99
-
100
- ``def is_assignable[T](value: object, typx: TypeForm[T]) -> TypeIs[T] ``
101
98
102
- - Pattern 2:
99
+ - Pattern 1: `` def is_assignable[T](value: object, typx: TypeForm[T]) -> TypeIs[T] ``
103
100
104
- ``def is_match[T](value: object, typx: TypeForm[T]) -> TypeGuard[T] ``
101
+ - Pattern 2: ``def is_match[T](value: object, typx: TypeForm[T]) -> TypeGuard[T] ``
105
102
106
103
- Examples: beartype.\ `is_bearable `_, trycast.\ `isassignable `_,
107
104
typeguard.\ `check_type `_, xdsl.\ `isa `_
@@ -119,7 +116,9 @@ would benefit from ``TypeForm``:
119
116
120
117
- Pattern 1:
121
118
122
- ``def convert[T](value: object, typx: TypeForm[T]) -> T ``
119
+ ::
120
+
121
+ def convert[T](value: object, typx: TypeForm[T]) -> T
123
122
124
123
- Examples: cattrs.BaseConverter.\ `structure `_, trycast.\ `checkcast `_,
125
124
typedload.\ `load `_
0 commit comments