Skip to content

Commit 1ba9194

Browse files
authored
ruff rule PLR1714 Consider merging multiple comparisons
1 parent 9bb185c commit 1ba9194

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

web_programming/emails_from_url.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None
3131
# Check the list of defined attributes.
3232
for name, value in attrs:
3333
# If href is defined, not empty nor # print it and not already in urls.
34-
if (
35-
name == "href"
36-
and value != "#"
37-
and value != ""
38-
and value not in self.urls
39-
):
34+
if name == "href" and value not in set(self.urls + ["", "#"]):
4035
url = parse.urljoin(self.domain, value)
4136
self.urls.append(url)
4237

0 commit comments

Comments
 (0)