Timeline for Get the first item from an iterable that matches a condition
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 18, 2022 at 2:49 | comment | added | Smart Manoj | None is expected | |
Apr 17, 2022 at 9:06 | comment | added | airborne | @SmartManoj: Of course match is not defined for an empty list. What value would you expect? The same accounts for any other list which does not include an element matching the condition. What's your point? | |
Apr 17, 2022 at 5:40 | comment | added | Smart Manoj | For empty list, match is not defined | |
Feb 28, 2022 at 19:53 | comment | added | Adam Parkin | That's a really great use of the walrus operator, quite elegant. | |
Aug 28, 2021 at 19:28 | comment | added | Walter Tross |
PEP 572 also has a couple of nice examples. Search for any( !
|
|
Feb 26, 2021 at 20:03 | history | answered | airborne | CC BY-SA 4.0 |