A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-May/100042.html below:

[Python-Dev] Possible patch for functools partial

[Python-Dev] Possible patch for functools partial - Interested?Steven D'Aprano steve at pearwood.info
Wed May 12 12:37:51 CEST 2010
On Wed, 12 May 2010 06:34:50 pm Stephen J. Turnbull wrote:
> Lie Ryan writes:
>  > it disappoints me this does not compare equal:
>  >
>  > add3 = lambda a, b, c: a + b + c
>  > a = partial(partial(add3, 1), 2)
>  > b = partial(partial(add3, 2), 1)
>  > print a == b
>  >
>  > :-)
>
> But it's not even true for floating point.<wink>


All humour aside, let's not ruin the chances of this patch being 
accepted by overloading it. I think there is a good use-case for 
partial objects to compare equal if they were constructed with 
arguments that compare equal. That's a nice, conservative change that 
is unlikely to lead to bugs, unlike some of the more "clever" proposals 
that rely on mathematical equivalences that don't hold for Python 
objects.



-- 
Steven D'Aprano
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