selectolax
selectolax copied to clipboard
[Typing] `_Attributes` in .pyi stub file is missing dictionary methods like `__getitem__`
Seems like _Attributes is missing methods from dict class, even though documentation states otherwise:
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