This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients ezio.melotti, pitrou, rhettinger, scoder, serhiy.storchaka
Date 2015-02-26.18:21:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1424974866.64.0.671805876328.issue23507@psf.upfronthosting.co.za>
In-reply-to
Content
> Maybe we want a facility to create on-stack static-size tuples?

There is no guarantee that called function doesn't save the reference to args.

> How many functions can benefit from this approach, though?

From hand-writing caching? Any function, that repeatedly call other functions many times. In additional to sorted()/list.sort() with the key argument, filter() and map(), these are min() and max() with the key argument, some iterators from itertools (groupby(), dropwhile(), takewhile(), accumulate(), filterfalse()). May be some functions that are thin wrappers around special method (e.g. round()).

But it is more interesting to investigate why PyTuple_New() is so slow in comparison with hand-written caching. It it can be speeded up, then mauch more code can benefit from this.
History
Date User Action Args
2015-02-26 18:21:06serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, pitrou, scoder, ezio.melotti
2015-02-26 18:21:06serhiy.storchakasetmessageid: <1424974866.64.0.671805876328.issue23507@psf.upfronthosting.co.za>
2015-02-26 18:21:06serhiy.storchakalinkissue23507 messages
2015-02-26 18:21:06serhiy.storchakacreate