"Structural pattern matching" for Python, part 2
"Structural pattern matching" for Python, part 2
Posted Sep 10, 2020 13:21 UTC (Thu) by mathstuf (subscriber, #69389)In reply to: "Structural pattern matching" for Python, part 2 by milesrout
Parent article: "Structural pattern matching" for Python, part 2
Ah, I see now what you're doing. Yes, that's a nifty trick (assuming you can guarantee that you're only using rebound variables rather than holding a window into a variable someone else eventually mutates). But it's Python and I consider that kind of thinking just necessary for making robust software in that language.