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

Clean __contains__ #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Clean __contains__ #3

wants to merge 1 commit into from

Conversation

stsievert
Copy link
Contributor

No description provided.

else:
return False
"""Boolean test of membership of a sample in the dataset."""
return item in self.keys
Copy link
Owner

Choose a reason for hiding this comment

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

Hey Scott, thanks for the PR. For a simple test, the suggested code is certainly more compact. However, I planned to add more functionality for [non-]membership, in case of multiple items or a more complex test (e.g. missing data). I should perhaps add a note or TODO here to reflect that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What more complex test would you add? Isn't missing data not contained in the dataset?

Copy link
Owner

Choose a reason for hiding this comment

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

For example, when the missing data is partial, or data is not of certain type across all subjects. I'm still thinking through other use cases, though. But thanks for the suggestion to compactify it.

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.

2 participants