Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5587a3

Browse files
Update type_inference_and_annotations.rst (#20619)
Fixes: #20612 --------- Co-authored-by: wyattscarpenter <[email protected]>
1 parent a547c51 commit b5587a3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/source/type_inference_and_annotations.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ on the declared type of ``arg`` in ``foo``:
159159
.. code-block:: python
160160
161161
def foo(arg: list[int]) -> None:
162-
print('Items:', ''.join(str(a) for a in arg))
162+
print('Items:', ', '.join(str(a) for a in arg))
163163
164164
foo([]) # OK
165165
@@ -170,7 +170,7 @@ in the following statement:
170170
.. code-block:: python
171171
172172
def foo(arg: list[int]) -> None:
173-
print('Items:', ', '.join(arg))
173+
print('Items:', ', '.join(str(a) for a in arg))
174174
175175
a = [] # Error: Need type annotation for "a"
176176
foo(a)

0 commit comments

Comments
 (0)