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 scooter4j
Recipients abcdef, docs@python, eric.smith, scooter4j
Date 2017-11-27.04:58:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAKZOSaiL=VRgJrcixJK2a+PhdXJZJLcUvp-ou=LhxCah3C1bvA@mail.gmail.com>
In-reply-to <1511718684.79.0.213398074469.issue32142@psf.upfronthosting.co.za>
Content
Fair statement. "Properly sorted" was a poor choice. Seems that "if the
invariant is true as a precondition, it will be true as a postcondition" is
accurate and descriptive -  maybe with a caution that modifying the list
(heap) values by means other than the heapq functions are likely to render
the invariant false (the latter phrase being for somewhat newbies like me
who wouldn't realize this truth without having to learn it in the debugger).

On Sun, Nov 26, 2017 at 10:51 AM, abcdef <report@bugs.python.org> wrote:

>
> abcdef <x@mailinator.com> added the comment:
>
> >  Perhaps heappop could say that the heap invariant is maintained if the
> heap is properly sorted before the heappop invocation.
>
> Honestly I like this wording less. "Properly sorted" would suggest sorted
> in the sense of heap.sort() [as the docs refer to this earlier], but the
> array doesn't have to be sorted; it's enough if it's a heap. The function
> always maintains the invariant - this means that if the invariant is true
> as a precondition, it will be true as a postcondition. Maybe you have a
> different idea?
>
> ----------
> nosy: +abcdef
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue32142>
> _______________________________________
>
History
Date User Action Args
2017-11-27 04:58:51scooter4jsetrecipients: + scooter4j, eric.smith, docs@python, abcdef
2017-11-27 04:58:51scooter4jlinkissue32142 messages
2017-11-27 04:58:50scooter4jcreate