Incorrect return annotation in functions find() and find_all()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Beautiful Soup |
New
|
Undecided
|
Unassigned |
Bug Description
When I was coding in my IDE I noticed that I get an error here but code still works just fine:
subsections = html.find_
for subsection in subsections:
links: list[str] = [obj.get("href") for obj in link_objects]
names: list[str] = [obj.text for obj in name_objects if obj.text != ""]
Unresolved attribute reference 'find' for class 'PageElement'
Unresolved attribute reference 'find_all' for class 'PageElement'
The reason why is because return annotation in these functions are Optional[
I ran print(isinstanc
To solve this issue I simply changed [PageElement] to [Tag] in bs4 element.py file