<div>Thanks, that's fair, for consistency.</div><div><br></div><div>One use case for my question was a stackoverflow question regarding merging two dict's.  If update() returned its own reference, and if we explicitly wanted a copy (instead of an in-place modification), we could have used</div>

<div><br></div><div>    dict(x).update(y)</div><div><br></div><div>given x and y are both dict() instances.</div><br clear="all">Cheers,<div>Xav</div><br>
<br><br><div class="gmail_quote">On 20 April 2012 22:35, Laurens Van Houtven <span dir="ltr"><_@lvh.cc></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

As a general rule, methods/functions in Python either *mutate* or *return*. (Obviously, mutating methods also return, they just return None)<br>
<br>
For example: random.shuffle shuffles in place so doesn't return anything<br>
list.sort sorts in place so doesn't return anything<br>
sorted creates a new sorted thing, so returns that sorted thing<br>
<br>
cheers<br>
lvh<br>
<div><div class="h5"><br>
<br>
<br>
On 20 Apr 2012, at 14:32, Xavier Ho wrote:<br>
<br>
> Hello,<br>
><br>
> What's the rationale behind the fact that `dict().update()` return nothing?  If it returned the dictionary reference, at least we could chain methods, or assign it to another variable, or pass it into a function, etc..<br>


><br>
> What's the design decision made behind this?<br>
><br>
> Cheers,<br>
> Xav<br>
><br>
</div></div>> _______________________________________________<br>
> Python-ideas mailing list<br>
> <a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
<br>
</blockquote></div><br>