You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just started using pudb, and I ran into this issue and couldn't figure out what was going on:
If I have a test script like this:
i = None
def test(l):
j = -1
for i in range(len(l)):
print l[i]
print l[j]
test(range(10))
And then I:
Run the script: python -m pudb.run test.py
Set a break point on line 5 (print l[i])
Continue until that break point is hit
Create an interactive shell with '!'
I get this behavior:
>>> print l
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> print j
-1
>>> print i
None
>>> print l[i]
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError: list indices must be integers, not NoneType
Or in other words the value of i is None, which is the value in the global scope, not the local scope. I would expect this value to be be 0. All the other local variables (j and l) display the values I would expect.
The text was updated successfully, but these errors were encountered:
Just started using pudb, and I ran into this issue and couldn't figure out what was going on:
If I have a test script like this:
And then I:
python -m pudb.run test.py
print l[i]
)I get this behavior:
Or in other words the value of
i
is None, which is the value in the global scope, not the local scope. I would expect this value to be be 0. All the other local variables (j
andl
) display the values I would expect.The text was updated successfully, but these errors were encountered: