23 May
2020
23 May
'20
1:37 a.m.
On 05/22/2020 05:11 PM, David Mertz wrote:
On 05/22/2020 04:43 AM, Steven D'Aprano wrote:
i = somelist.index(needle, pred=comparison)
Why not just this (by object, not by its index, but that seems simpler):
do_something(next(filter(pred, somelist))) Something about 55 somelist [3, 4, 29, 23, 46, 55, 90, 81] pred
Steven, using David's example list, what would `needle` and `comparison` be in your proposal? -- ~Ethan~