|
|
Log in / Subscribe / Register

"Structural pattern matching" for Python, part 2

"Structural pattern matching" for Python, part 2

Posted Sep 3, 2020 13:22 UTC (Thu) by hartb (subscriber, #96640)
In reply to: "Structural pattern matching" for Python, part 2 by tnemeth
Parent article: "Structural pattern matching" for Python, part 2

I guess you still have the object-to-be-matched handy:

match t:
    ...
    case _:
        print("error: ", str(t))


The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:

Note: you can avoid this step in the future by logging into your LWN account.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds