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

Implement nonzero/bool methods to override len #988

Closed
philippjfr opened this issue Nov 16, 2016 · 2 comments
Closed

Implement nonzero/bool methods to override len #988

philippjfr opened this issue Nov 16, 2016 · 2 comments
Milestone

Comments

@philippjfr
Copy link
Member

Currently when testing any HoloViews object for "truthiness" it uses the __len__ method. In #974 we added the dask interface, which doesn't actually know it's length because it loads the data lazily. Therefore we should implement __nonzero__ (Python 2) and __bool__ (Python 3) methods, which take precedence over the length. Additionally we should confirm that all the code in HoloViews uses the implicit boolean truthiness to check for a zero length element rather than explicitly calling len.

@philippjfr
Copy link
Member Author

Implemented in PR referenced above.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant