Skip to content

Clean unreachable #37092

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions pandas/core/computation/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ def create_valid_python_identifier(name: str) -> str:
# toke.tok_name contains a readable description of the replacement string.
special_characters_replacements = {
char: f"_{token.tok_name[tokval]}_"
# The ignore here is because of a bug in mypy that is resolved in 0.740
for char, tokval in (
tokenize.EXACT_TOKEN_TYPES.items() # type: ignore[attr-defined]
)
Comment on lines -39 to -42
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes unused ignore in mypy=0.790.

for char, tokval in (tokenize.EXACT_TOKEN_TYPES.items())
}
special_characters_replacements.update(
{
Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/frame/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,8 +1079,7 @@ def test_constructor_empty_list(self):

# Empty generator: list(empty_gen()) == []
def empty_gen():
return
yield
yield from ()

df = DataFrame(empty_gen(), columns=["A", "B"])
tm.assert_frame_equal(df, expected)
Expand Down