Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
~/dev/cpython main λ cat z.py import randomdef foo(): yield random.randint(100) # oops, only passed in one argument yield "value"dict([foo() for _ in range(3)])~/dev/cpython main λ python3.12 z.py Traceback (most recent call last): File "/Users/shantanu/dev/cpython/z.py", line 7, in <module> dict([foo() for _ in range(3)])TypeError: cannot convert dictionary update sequence element #0 to a sequenceI'd expect something like what PyPy gives:
Traceback (most recent call last): File "/Users/shantanu/dev/cpython/z.py", line 7, in <module> dict([foo() for _ in range(3)]) File "/Users/shantanu/dev/cpython/z.py", line 4, in foo yield random.randint(100) # oops, only passed in one argument ^^^^^^^^^^^^^^^^^^^TypeError: Random.randint() missing 1 required positional argument: 'b'