Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New ValueError case #164

Closed
aroberge opened this issue Sep 15, 2022 · 0 comments
Closed

New ValueError case #164

aroberge opened this issue Sep 15, 2022 · 0 comments

Comments

@aroberge
Copy link
Contributor

Consider the following

[1]: foo = ["a", "b"]

[2]: for i in ["c"]:
...:    foo.remove(i)
...:

Traceback (most recent call last):
  Code block [2], line 2
    foo.remove(i)
ValueError: list.remove(x): x not in list

Friendly-traceback does not know the cause of this error.
[3]: where()

Exception raised on line 2 of code block [2].

       1| for i in ["c"]:
     > 2|    foo.remove(i)

    foo:  ['a', 'b']
    i:  'c'
    foo.remove:  <builtin method remove of list object>

Given that I have access to all the variable values at this point, it should be fairly straightforward to provide a helpful hint.

Source: python/cpython#96844

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant