Re:Understanding a Python Closure Oddity
by Spivak on Monday June 17, 2024 @09:37AM
(#40705499)
This is less wat. when you write it like
Each next() into loop increments a shared counter so when you print it out as you go it 1, 2, 3 but when you print it out once you've called it a bunch is 9, 9, 9.
[ Parent
| on HN ]
There are no comments on this comment yet.