From 7e19d14bc862993a1eb4c0f9fb94fabe064ba4e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Cvacho?= Date: Tue, 11 Apr 2023 23:18:20 +0200 Subject: [PATCH 1/2] Fix alignment of cheat sheet example --- docs/source/cheat_sheet_py3.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/cheat_sheet_py3.rst b/docs/source/cheat_sheet_py3.rst index 24621537cf626..e31d510d7b88f 100644 --- a/docs/source/cheat_sheet_py3.rst +++ b/docs/source/cheat_sheet_py3.rst @@ -103,9 +103,9 @@ Functions def show(value: str, excitement: int = 10) -> None: print(value + "!" * excitement) - # Note that arguments without a type are dynamically typed (treated as Any) - # and that functions without any annotations not checked - def untyped(x): + # Note that arguments without a type are dynamically typed (treated as Any) + # and that functions without any annotations not checked + def untyped(x): x.anything() + 1 + "string" # no errors # This is how you annotate a callable (function) value From 555e4b544ea56a2a861630c593dc9adbe9a0d7be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Cvacho?= Date: Tue, 11 Apr 2023 23:22:31 +0200 Subject: [PATCH 2/2] Forgot function block indentation --- docs/source/cheat_sheet_py3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/cheat_sheet_py3.rst b/docs/source/cheat_sheet_py3.rst index e31d510d7b88f..9533484e938bc 100644 --- a/docs/source/cheat_sheet_py3.rst +++ b/docs/source/cheat_sheet_py3.rst @@ -106,7 +106,7 @@ Functions # Note that arguments without a type are dynamically typed (treated as Any) # and that functions without any annotations not checked def untyped(x): - x.anything() + 1 + "string" # no errors + x.anything() + 1 + "string" # no errors # This is how you annotate a callable (function) value x: Callable[[int, float], float] = f