heapreplace, methodcaller

2008-10-18 Thread bearophileHUGS
Hello, I'm experimenting more with Python 2.6 and its numerous changes. To improve name coherence I think this method of the heapq module: heapq.heapreplace(heap, item) can grow an alias in Python 2.6.1/2.7 and 3.0/3.1: heapq.heappoppush(heap, item) So later the heapreplace() name can be

Re: heapreplace, methodcaller

2008-10-18 Thread Marc 'BlackJack' Rintsch
On Sat, 18 Oct 2008 07:01:26 -0700, bearophileHUGS wrote: Hello, I'm experimenting more with Python 2.6 and its numerous changes. […] Regarding the operators module, this syntax: methodcaller('replace', 'old', 'new') Has this meaning: lambda s: s.replace('old', 'new') I don't know

Re: heapreplace, methodcaller

2008-10-18 Thread Raymond Hettinger
On Oct 18, 7:01 am, [EMAIL PROTECTED] wrote: To improve name coherence I think this method of the heapq module: heapq.heapreplace(heap, item) can grow an alias in Python 2.6.1/2.7 and 3.0/3.1: heapq.heappoppush(heap, item) So later the heapreplace() name can be deprecated. Too late for 2.6