From f9c4f091bd1e1837113bce6c7a6ad503410f0fc0 Mon Sep 17 00:00:00 2001 From: David Foster Date: Tue, 17 Sep 2024 09:05:57 -0400 Subject: [PATCH] PEP 747: TypeForm use cases: Adjust code block formatting to be consistent/concise --- peps/pep-0747.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/peps/pep-0747.rst b/peps/pep-0747.rst index 95f0120f213..1d5483ad77d 100644 --- a/peps/pep-0747.rst +++ b/peps/pep-0747.rst @@ -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`_ @@ -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`_