Open
Description
There were multiple issues identified with the code of SelectorList
itself, Selector.selectorlist_cls
and their typing. Ideally:
SelectorList
should only be able to containSelector
objectsSelectorList
subclasses made to work withSelector
subclasses should only able to contain thoseSelector
subclasses shouldn't need to setselectorlist_cls
to a respectiveSelectorList
subclass manually- all of this should be properly typed without need for casts and other overrides
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).