>>> timeit.timeit('[x >= 0 and x % 1 == 0 for x in range(100)]', number=1000000)
5.681200352031738
>>> timeit.timeit('[x >= 0 & x % 1 == 0 for x in range(100)]', number=1000000)
7.641936696134508
What does your PR belong to?
[ ] Website
[X] Snippets
[ ] General / Things regarding the repository (like CI Integration)
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[X] Enhancement (non-breaking improvement of a snippet)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[X] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[X] I have checked that the changes are working properly
[X] I have checked that there isn't any PR doing the same
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for any follow-up tasks.
Description
and is faster
What does your PR belong to?
Types of changes
Checklist: