7 Comments

So well explained! There are many articles like it, but this is the best one I ever read on this topic!

May I translate this article for my French students and publish the translated version on my website (with a link to the original content, of course)?

In any case, thank you

Expand full comment

Yes, I give you the licence to translate, modify and distribute this article

Expand full comment

Cool!

Any particular license? And if needed, what author name should I indicate?

Expand full comment

No, just this licence for you. Use "Bite code" for the name, it's enough.

Enjoy

Expand full comment

OK, thank you so much !

Expand full comment

Nice.

One trap I've hit sevreal times is: I think I copied an object, like a=b. But all Python does is make a & b point to the same object, so modifying b also changes a!

It's very painful to debug when this goes wrong.

The solution, I found, is to always use deepcopy() when you want to create a new object. But this isn't intuitive, and searching online doesnt give you the simple answer (unless you already know what the problem is)

Expand full comment

I should explain this in the article

Expand full comment