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/2002-August/028322.html below:

[Python-Dev] Re: heapq method names

[Python-Dev] Re: heapq method names [Python-Dev] Re: heapq method namesRaymond Hettinger python@rcn.com
Mon, 26 Aug 2002 10:55:15 -0400
From: "Tim Peters" <tim.one@comcast.net>
> If you want simpler names, I'm finding this little module quite pleasant to
> use:
> 
> """
> import heapq
> 
> class Heap(list):
>     def __init__(self, iterable=[]):
>         self.extend(iterable)
>     push    = heapq.heappush
>     popmin  = heapq.heappop
>     replace = heapq.heapreplace
>     heapify = heapq.heapify
> """

And perhaps:
   def __iter__(self):
       while True:
            yield self.popmin()

Raymond Hettinger




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