7 Comments
User's avatar
jmg74's avatar

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
Bite Code!'s avatar

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

Expand full comment
jmg74's avatar

Cool!

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

Expand full comment
Bite Code!'s avatar

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

Enjoy

Expand full comment
jmg74's avatar

OK, thank you so much !

Expand full comment
Shantnu's avatar

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
Bite Code!'s avatar

I should explain this in the article

Expand full comment