Skip to content

Modernize SelectorList-related code #263

Open
@wRAR

Description

@wRAR

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

  • SelectorList should only be able to contain Selector objects
  • SelectorList subclasses made to work with Selector subclasses should only able to contain those
  • Selector subclasses shouldn't need to set selectorlist_cls to a respective SelectorList 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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions