diff --git a/docs/source/type_inference_and_annotations.rst b/docs/source/type_inference_and_annotations.rst index 318ca4cd9160..8c6150e72497 100644 --- a/docs/source/type_inference_and_annotations.rst +++ b/docs/source/type_inference_and_annotations.rst @@ -159,7 +159,7 @@ on the declared type of ``arg`` in ``foo``: .. code-block:: python def foo(arg: list[int]) -> None: - print('Items:', ''.join(str(a) for a in arg)) + print('Items:', ', '.join(str(a) for a in arg)) foo([]) # OK @@ -170,7 +170,7 @@ in the following statement: .. code-block:: python def foo(arg: list[int]) -> None: - print('Items:', ', '.join(arg)) + print('Items:', ', '.join(str(a) for a in arg)) a = [] # Error: Need type annotation for "a" foo(a)