diff --git a/pandas/core/computation/parsing.py b/pandas/core/computation/parsing.py index 86e125b6b909b..ab7c1a9f0cf23 100644 --- a/pandas/core/computation/parsing.py +++ b/pandas/core/computation/parsing.py @@ -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] - ) + for char, tokval in (tokenize.EXACT_TOKEN_TYPES.items()) } special_characters_replacements.update( { diff --git a/pandas/tests/frame/test_constructors.py b/pandas/tests/frame/test_constructors.py index 8ec11d14cd606..00f1a75719443 100644 --- a/pandas/tests/frame/test_constructors.py +++ b/pandas/tests/frame/test_constructors.py @@ -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)