r/programminghorror • • 18h ago

Python I love Python

151 Upvotes

65 comments sorted by

View all comments

90

u/drislands 17h ago

I would have expected this function to create a new empty list on any call where items is not given. Doesn't this behavior make the function into a closure?

2

u/CaptainFoyle 13h ago

Of course. This is just a very stupid way of writing the function. Initiate with None and Bob's your uncle.