3 ms·
Python closes over names, not objects. This is consistent with the rest of Python, which treats names as references to objects rather than variables which hold
by MostAwesomeDude 15y ago
Python closes over names, not objects. This is consistent with the rest of Python, which treats names as references to objects rather than variables which hold objects. I do agree that it's confusing for people used to closures and used to languages with different semantics.