News for hackers. Stuff that matters.
Re:Why Do Python Lists Multiply Oddly? Exploring the CPython... by kerkeslager on Tuesday April 09, 2024 @11:10AM (#39980281)
> In real life, if I ask someone to go get me four empty buckets, I expect them to come back with four distinct empty buckets.

That's not what you're asking for, though. You're asking for one bucket, and then you're putting it in another bucket, and then you're duplicating the contents of the second bucket four times.

This isn't whitewashing, this is just what those expressions mean.

It's not like it's hard to get four buckets in Python, BTW:

    [[] for _ in range(4)]

There are no comments on this comment yet.