Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize SelectorList-related code #263

Open
wRAR opened this issue Nov 1, 2022 · 0 comments
Open

Modernize SelectorList-related code #263

wRAR opened this issue Nov 1, 2022 · 0 comments

Comments

@wRAR
Copy link
Member

wRAR commented Nov 1, 2022

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant