A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2010-September/103536.html below:

[Python-Dev] Behaviour of max() and min() with equal keys

[Python-Dev] Behaviour of max() and min() with equal keysMark Dickinson dickinsm at gmail.com
Wed Sep 8 00:03:04 CEST 2010
On Tue, Sep 7, 2010 at 11:00 PM, Mark Dickinson <dickinsm at gmail.com> wrote:
> On Tue, Sep 7, 2010 at 10:51 PM, Mark Dickinson <dickinsm at gmail.com> wrote:
>> On Tue, Sep 7, 2010 at 10:47 PM, Jeffrey Yasskin <jyasskin at gmail.com> wrote:
>>> It's ignoring the order of the arguments. It also creates
>>> a new Decimal object for the return value, so I can't use id() to
>>> check which one of identical elements it returns.
>>
>> This bit surprises me.  I honestly thought I'd fixed it up so that
>> max(x, y) actually returned one of x and y (and min(x, y) returned the
>> other).  Oh well.
>
> Ah.  I'd forgotten that the Decimal max and min methods are context
> aware, so that max(x, y) is rounded to the current context, and hence
> can actually be different from both x and y.  So that was a bad
> example from me.  Sorry.

Grr. s/max(x, y)/x.max(y)/g

Mark
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4