Inplace functions in Python
<p>In Python there is a concept of inplace functions. For example shuffle is inplace in that it returns none.</p>

<p>How do I determine if a function will be inplace or not?</p>

<pre><code>from random import shuffle

print(type(shuffle))

&lt;class 'method'&gt;
</code></pre>

<p>So I know it's a <code>method</code> from class <code>random</code> but is there a special variable that defines some functions as inplace?</p>

<p>I don't think there is special variable that defines some function as in-place but a standard function should have a doc string that says that it is in-place and does not return any value. For example:</p>

<p><code>&gt;&gt;&gt; print(shuffle.__doc__)</code></p>

<p><code>Shuffle list x in place, and return None.</code></p>

<pre><code>    `Optional argument random is a 0-argument function returning a
    random float in [0.0, 1.0); if it is the default None, the
    standard random.random will be used.`
</code></pre>

python function python-3.x