-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
collectionsData structures holding multiple items, e.g. setsData structures holding multiple items, e.g. sets
Description
I think it would be useful to add a method of count that takes a single iterable argument of booleans and returns the number of true elements.
For example (imagine that the function iseven does not exist), I find this:
count(i % 2 == 0 for i in 1:10)to be more readable than this:
count(i -> i % 2 == 0, 1:10)Metadata
Metadata
Assignees
Labels
collectionsData structures holding multiple items, e.g. setsData structures holding multiple items, e.g. sets