Skip to content

Commit

Permalink
PEP 747: TypeForm use cases: Adjust code block formatting to be consi…
Browse files Browse the repository at this point in the history
…stent/concise
  • Loading branch information
davidfstr committed Sep 17, 2024
1 parent 9ee5d8a commit 2c38797
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions peps/pep-0747.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,10 @@ would benefit from ``TypeForm``:
- Assignability checkers:

- Determines whether a value is assignable to a specified type
- Pattern 1:

``def is_assignable[T](value: object, typx: TypeForm[T]) -> TypeIs[T]``

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

``def is_match[T](value: object, typx: TypeForm[T]) -> TypeGuard[T]``
- Pattern 2: ``def is_match[T](value: object, typx: TypeForm[T]) -> TypeGuard[T]``

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

- Pattern 1:

``def convert[T](value: object, typx: TypeForm[T]) -> T``
::

def convert[T](value: object, typx: TypeForm[T]) -> T

- Examples: cattrs.BaseConverter.\ `structure`_, trycast.\ `checkcast`_,
typedload.\ `load`_
Expand Down

0 comments on commit 2c38797

Please sign in to comment.