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

Replace ObjectSelector with Selector #497

Merged
merged 11 commits into from
Jul 2, 2021
Merged

Replace ObjectSelector with Selector #497

merged 11 commits into from
Jul 2, 2021

Conversation

jbednar
Copy link
Member

@jbednar jbednar commented Jun 28, 2021

Fixes #493

@jbednar jbednar requested a review from jlstevens June 28, 2021 23:01
@jbednar
Copy link
Member Author

jbednar commented Jun 29, 2021

Note that ListSelector, FileSelector, and MultiFileSelector all still use the convention from ObjectSelector where the first argument is the default value, not the objects list, and where the default value must be specified since it won't be computed from the objects list. Changing those things breaks backwards compatibility, so shouldn't be done lightly.

@jbednar
Copy link
Member Author

jbednar commented Jun 30, 2021

Added a fix for #307 .

# existing objects, therefore instantiate is False by default.
def __init__(self, default=None, objects=None, instantiate=False,
def __init__(self, objects=None, default=None, instantiate=False,
Copy link
Contributor

@jlstevens jlstevens Jul 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This order is indeed better but in theory could break anyone passing in the arguments by position. This causing an issue is very unlikely in practice as I don't think I've ever seen that style of signature so overall I consider this an improvement.

@jlstevens
Copy link
Contributor

Looks good!

Sorry for not reviewing before merge but I don't see anything I would have objected to (other than a minor typo fix that I'll push a PR for now).

@jlstevens jlstevens mentioned this pull request Jul 5, 2021
@maximlt maximlt mentioned this pull request Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Selectors should inherit from Selector, not ObjectSelector
2 participants