1 SUSPECT #1
x = [1, 2, 3]
it = iter(x)
for _ in range(4):
next(it) Traceback (most recent call last):
File "lineup.py", line 4, in <module>
next(it)
~~~~^^^^
StopIteration 2 SUSPECT #2
def gen():
yield 1
raise StopIteration
list(gen()) Traceback (most recent call last):
File "lineup.py", line 3, in gen
raise StopIteration
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "lineup.py", line 4, in <module>
list(gen())
~~~~^^^^^^^
StopIteration 3 SUSPECT #3
def f(d={}):
return d["k"]
f() Traceback (most recent call last):
File "lineup.py", line 3, in <module>
f()
~^^
File "lineup.py", line 2, in f
return d["k"]
~^^^^^
KeyError: 'k' 4 SUSPECT #4
import types
ns = types.SimpleNamespace(a=1)
ns.b Traceback (most recent call last):
File "lineup.py", line 3, in <module>
ns.b
AttributeError: 'types.SimpleNamespace' object has no attribute 'b' 5 SUSPECT #5
class Base:
def __init__(self, v):
self.v = v
class Sub(Base):
def __init__(self):
super().__init__()
Sub() Traceback (most recent call last):
File "lineup.py", line 7, in <module>
Sub()
~~~^^
File "lineup.py", line 6, in __init__
super().__init__()
~~~~~~~~~~~~~~~~^^
TypeError: Base.__init__() missing 1 required positional argument: 'v'