On Thu, May 13, 2010 at 13:30, Steven D'Aprano <st...@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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com