scrapy / parsel

Parsel lets you extract data from XML/HTML documents using XPath or CSS selectors
BSD 3-Clause "New" or "Revised" License
1.11k stars 137 forks source link

Modernize SelectorList-related code #263

Open wRAR opened 1 year ago

wRAR commented 1 year ago

There were multiple issues identified with the code of SelectorList itself, Selector.selectorlist_cls and their typing. Ideally:

This may require changing Selector and/or SelectorList base classes, but I think we will need to keep the API compatibility? It's also non-trivial because the API for subclassing them doesn't seem to be documented, the only reference is SelectorTestCase.test_extending_selector() (the related code was also changed when adding typing, not sure if it changed the interface).