Why in principle an in-place-modifying method should return None : <p>A language design question.</p>

<p>Taking Python as example.</p>

<p>Quoting a <a href="https://stackoverflow.com/questions/22442378/what-is-the-difference-between-sortedlist-vs-list-sort#comment81703173_22442440">comment</a> in an answer to a question concerning the difference between <code>list.sort()</code> and <code>sorted()</code>:</p>

<blockquote>
  <p>In general, when a python function returns None, it is a sign, that the operations are done in place, that's why, when you want to print list.sort() it returns None.</p>
</blockquote>

<p>I am wondering the reason for the language-design principle that an in-place-modifying method should return <code>None</code>. Just for curiosity, say, why cannot <code>list.sort()</code> (and other in-place-modifying functions/methods) return itself?</p>

<p>A possbile argument is that doing so avoids creating a copy and could be faster. However, copying a list in Python only creates a reference and shouldn't be much expensive.</p>

<p>Another argument could be <code>list.sort()</code>, from its literal meaning, shouldn't be an object. Then what about having another method that both modifies list in place and returns a copy -- call it <code>list.sorted()</code>? I guess having such a method will facilitate certain usage.</p>
