Efficient Wrappers for Instance Methods

Sven R. Kunze srkunze at mail.de
Wed Feb 3 16:43:23 EST 2016


On 03.02.2016 22:19, Peter Otten wrote:
>
> You could try putting
>
> self.heappush = functools.partial(heapq.heappush, self)
>
> into the initializer.

Actually a nice idea if there were no overhead of creating methods for 
all heap instances separately. I'll keep that in mind. :)


More information about the Python-list mailing list