Author rhettinger
Recipients corona10, rhettinger, vstinner
Date 2021-02-21.18:40:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1613932856.73.0.0857313386809.issue43287@roundup.psfhosted.org>
In-reply-to
Content
+0 I don't see any downside.

Note, the benchmark only times instantiation of the filter object.  It doesn't actually run the iterator which is where most of the runtime cost is spent.  So in actual code there is almost zero benefit.  For example, add "list" to the statement:   stmt="b = list(filter(lambda x: x % 2 == 0, a))" and the improvement disappears.
History
Date User Action Args
2021-02-21 18:40:56rhettingersetrecipients: + rhettinger, vstinner, corona10
2021-02-21 18:40:56rhettingersetmessageid: <1613932856.73.0.0857313386809.issue43287@roundup.psfhosted.org>
2021-02-21 18:40:56rhettingerlinkissue43287 messages
2021-02-21 18:40:56rhettingercreate