Skip to content

Commit a5b63cb

Browse files
authored
PEP 747: Fix code block formatting. Fix grammar. (#4006)
1 parent c778ab9 commit a5b63cb

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

peps/pep-0747.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ an overly-wide type like ``object``, which makes some use cases impossible and
2626
generally reduces type safety. This PEP addresses this limitation by
2727
introducing a new special form ``typing.TypeForm``.
2828

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
3030
intended to be enforced only by type checkers, not by the Python runtime.
3131

3232

@@ -95,13 +95,10 @@ would benefit from ``TypeForm``:
9595
- Assignability checkers:
9696

9797
- 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]``
10198

102-
- Pattern 2:
99+
- Pattern 1: ``def is_assignable[T](value: object, typx: TypeForm[T]) -> TypeIs[T]``
103100

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]``
105102

106103
- Examples: beartype.\ `is_bearable`_, trycast.\ `isassignable`_,
107104
typeguard.\ `check_type`_, xdsl.\ `isa`_
@@ -119,7 +116,9 @@ would benefit from ``TypeForm``:
119116

120117
- Pattern 1:
121118

122-
``def convert[T](value: object, typx: TypeForm[T]) -> T``
119+
::
120+
121+
def convert[T](value: object, typx: TypeForm[T]) -> T
123122

124123
- Examples: cattrs.BaseConverter.\ `structure`_, trycast.\ `checkcast`_,
125124
typedload.\ `load`_

0 commit comments

Comments
 (0)