Message335101
+1 from me as well.
I like your count() solution because 1) it gives the same answer for both an iterator and for an iterable 2) it preserves the memory friendly characteristics of iterators, 3), it is still reasonably fast, and 4) the function signature is still simple.
My top name preference is "fmean" because I'm used to "isqrt" for integers, "fsqrt" for floats, and "cmath" for complex where the first letter means the type. Incidentally, that is why "fsum" is named with an "f". My second choice is "fastmean" without an underscore. To my ear, "float_mean" is confusing, as if "float" were a verb and "mean" were the direct object, the antonym of "sink_mean" ;-) |
|
Date |
User |
Action |
Args |
2019-02-08 17:56:05 | rhettinger | set | recipients:
+ rhettinger, tim.peters, mark.dickinson, steven.daprano, josh.r |
2019-02-08 17:56:04 | rhettinger | set | messageid: <1549648564.54.0.690550451617.issue35904@roundup.psfhosted.org> |
2019-02-08 17:56:04 | rhettinger | link | issue35904 messages |
2019-02-08 17:56:04 | rhettinger | create | |
|