mastodon.green is one of the many independent Mastodon servers you can use to participate in the fediverse.
Plant trees while you use Mastodon. A server originally for people in the EU, but now open for anyone in the world

Administered by:

Server stats:

1.2K
active users

#pythongotcha

0 posts0 participants0 posts today
Eric Maugendre<p><a href="https://hachyderm.io/tags/PythonGotcha" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PythonGotcha</span></a> 🧵</p><p>It is often useful to make a <a href="https://hachyderm.io/tags/copy" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>copy</span></a> of a given list before performing operations that would mutate the elements.</p><p>When you make a shallow copy of an existing list, you create a new pointer to a new list object that points to the same old elements. (It saves memory.)</p><p>On the other hand, if you make a deep copy, then you create a completely new copy of the original list.</p><p>In other words: <a href="https://realpython.com/python-mutable-vs-immutable-types/#making-copies-of-lists" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">realpython.com/python-mutable-</span><span class="invisible">vs-immutable-types/#making-copies-of-lists</span></a></p><p><a href="https://hachyderm.io/tags/learning" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>learning</span></a> <a href="https://hachyderm.io/tags/objects" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>objects</span></a> <a href="https://hachyderm.io/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://hachyderm.io/tags/dev" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>dev</span></a> <a href="https://hachyderm.io/tags/CS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CS</span></a> <a href="https://hachyderm.io/tags/DataScience" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DataScience</span></a> <a href="https://hachyderm.io/tags/memory" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>memory</span></a> <a href="https://hachyderm.io/tags/dataDev" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>dataDev</span></a></p>