Skip to content

Commit 060536d

Browse files
authored
STYLE: Fix or suppress non-iterator-returned errors from pylint (#49036)
* Working on finding issues with non-iterator-returned * Found one instance to suppress * Misread the error message, suppressed wrong line. * Change test so that pylint treats it as iterator * Fix formatting. * Added reference to PR in comment.
1 parent f2a91a0 commit 060536d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pandas/tests/io/test_html.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1280,9 +1280,14 @@ def seek(self, offset):
12801280
def seekable(self):
12811281
return True
12821282

1283+
# GH 49036 pylint checks for presence of __next__ for iterators
1284+
def __next__(self):
1285+
...
1286+
12831287
def __iter__(self) -> Iterator:
1284-
# to fool `is_file_like`, should never end up here
1285-
assert False
1288+
# `is_file_like` depends on the presence of
1289+
# the __iter__ attribute.
1290+
return self
12861291

12871292
good = MockFile("<table><tr><td>spam<br />eggs</td></tr></table>")
12881293
bad = MockFile("<table><tr><td>spam<foobr />eggs</td></tr></table>")

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ disable = [
7070
"no-method-argument",
7171
"no-name-in-module",
7272
"no-value-for-parameter",
73-
"non-iterator-returned",
7473
"not-an-iterable",
7574
"not-callable",
7675
"redundant-keyword-arg",

0 commit comments

Comments
 (0)