3 ms·
I understand how it is sort of a detail of how python works. But I also can't understand why someone thought "hmm. this is rather unexpected. Let's keep it that
by Johnny_Brahms 10y ago
I understand how it is sort of a detail of how python works. But I also can't understand why someone thought "hmm. this is rather unexpected. Let's keep it that way". It would be trivial to have python re-create an empty list.
Or is this pattern actually used? It seems rather perl5-y.
- detaro 10y agoFor empty lists it would be trivial, yes, but for arbitrary objects it wouldn't be. And only the empty list behaving different would be weird.