Open ThirVondukr opened 8 months ago
Seems like _Attributes is missing methods from dict class, even though documentation states otherwise:
_Attributes
dict
Examples -------- >>> tree = HTMLParser("<div id='a'></div>") >>> node = tree.css_first('div') >>> node.attrs <div attributes, 1 items> >>> node.attrs['id'] 'a'
Reproduction:
from selectolax.parser import HTMLParser parser = HTMLParser("") element = parser.css_first(".class") print(element.attrs["some-attr"])
main.py:5:7: error: Value of type "_Attributes" is not indexable [index] print(element.attrs["some-attr"])
Python version: 3.11.7 Selectolax version: 0.3.18 Mypy: 1.8.0
Seems like
_Attributes
is missing methods fromdict
class, even though documentation states otherwise:Reproduction:
Python version: 3.11.7 Selectolax version: 0.3.18 Mypy: 1.8.0