Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    PEP 572 also has a couple of nice examples. Search for any(! Commented Aug 28, 2021 at 19:28
  • 1
    That's a really great use of the walrus operator, quite elegant. Commented Feb 28, 2022 at 19:53
  • 1
    For empty list, match is not defined Commented Apr 17, 2022 at 5:40
  • 1
    @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?
    – airborne
    Commented Apr 17, 2022 at 9:06
  • 1
    None is expected Commented Apr 18, 2022 at 2:49