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/100087.html below:

[Python-Dev] Possible patch for functools partial

[Python-Dev] Possible patch for functools partial - Interested? [Python-Dev] Possible patch for functools partial - Interested?Daniel Urban urban.dani at gmail.com
Thu May 13 18:48:15 CEST 2010
On Thu, May 13, 2010 at 13:30, Steven D'Aprano <steve at pearwood.info> wrote:
> I'd support an immutable dict. partial objects already impose a
> significant (~ 30%) performance penalty:
>
>>>> from timeit import Timer
>>>> min(Timer('f(5)', 'f = lambda x: x').repeat())
> 0.93580079078674316
>>>> min(Timer('p(5)', 'from functools import partial; p = partial(lambda
> x: x)').repeat())
> 1.2715129852294922
>
> No need to make that worse if that can be avoided.

I've made a new patch, in which the keywords attribute is a read-only
proxy of the dictionary. I've used your benchmark, and I haven't found
any significant difference in execution times.
The patch is in the tracker (http://bugs.python.org/issue8699) and
Rietveld (http://codereview.appspot.com/1179044).


Daniel Urban
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