"Structural pattern matching" for Python, part 2
"Structural pattern matching" for Python, part 2
Posted Sep 9, 2020 14:37 UTC (Wed) 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
Hmm. That doesn't seem fool-proof:
>>> d = []
>>> f = lambda x=d: print(x)
>>> f()
[]
>>> d.append(3)
>>> f()
[3]
Unless I'm missing what you're trying to capture here?
