Message293195
* Some functions that accept an arbitrary iterable first convert it to temporary list and iterate that list. In these cases there is no significant difference in memory usage between list comprehension and generator, but the variant with list comprehension is slightly faster.
* foo(bar(x) for x in a) can be written also as foo(map(bar, a)). Both expressions are idiomatic, different users have different preferences, the variant with map can be faster for larger loops. The variant with map can even be faster than comprehensions.
* Proposed patch changes some files which should be kept compatible with old Python versions. Old Python versions can not support set and dict comprehensions.
* In general we avoid making changes to many files that doesn't have obvious positive effect. Most changes doesn't have measurable effect, they are just style changes. But different users have different preferences and existing code is not obviously bad.
Assigned to Raymond because it usually opposed to such kind of changes but made very similar changes in issue22823. |
|
Date |
User |
Action |
Args |
2017-05-07 13:55:58 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, steven.daprano, jdufresne |
2017-05-07 13:55:58 | serhiy.storchaka | set | messageid: <1494165358.86.0.452458498195.issue30296@psf.upfronthosting.co.za> |
2017-05-07 13:55:58 | serhiy.storchaka | link | issue30296 messages |
2017-05-07 13:55:58 | serhiy.storchaka | create | |
|