<story><title>Rust Ownership Explained with Python</title><url>https://paulkernfeld.com/2018/09/16/ownership-explained-with-python.html#</url></story><parent_chain></parent_chain><comment><author>shmageggy</author><text>Not that it really matters, but since he lamented that the second Python solution was &amp;quot;longer and less elegant&amp;quot;, I&amp;#x27;ll point out that that algorithm can be written in a functional style that is both short and (IMO) somewhat elegant. However with reduce being removed as a built-in since Python 3, this is arguably not Pythonic.&lt;p&gt;&lt;pre&gt;&lt;code&gt;    from functools import reduce
    
    squares = (x * x for x in range(10))
    
    min_and_max = lambda current, x: [min(current[0], x), max(current[1], x)]
    minimum, maximum = reduce(min_and_max, squares, [next(squares)]*2)
    
    print(minimum)
    print(maximum)&lt;/code&gt;&lt;/pre&gt;</text></comment>
<story><title>Rust Ownership Explained with Python</title><url>https://paulkernfeld.com/2018/09/16/ownership-explained-with-python.html#</url></story><parent_chain></parent_chain><comment><author>bayesian_horse</author><text>As a Rust beginner I am not quite sure why .min() is supposed to take ownership and change the sequence. I would assume it does nothing with the sequence except read it.</text></comment>