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 hp685
Recipients hp685, steven.daprano
Date 2020-02-14.22:30:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAJT45QioWnFdR_eVVQWss9vdbNVmuC6iNCH-ojmuCSPqqGFVwA@mail.gmail.com>
In-reply-to <1581717564.42.0.271702525987.issue39634@roundup.psfhosted.org>
Content
This ticket is not intended to rename heapify method in the stdlib (its too
late for that). This is to merely add a clarification in the docs to state
that heapify here has a different connotation than what's used in standard
algorithmic literature (CLRS, Sedgewick etc).  See here
https://xlinux.nist.gov/dads/HTML/heapify.html

References:
https://algs4.cs.princeton.edu/24pq/
http://math.utoledo.edu/~codenth/Fall_16/4380/heap-hw.pdf

On Fri, Feb 14, 2020 at 2:00 PM Steven D'Aprano <report@bugs.python.org>
wrote:

>
> Steven D'Aprano <steve+python@pearwood.info> added the comment:
>
> The "-ify" or "-fy" suffix in English means "to make". For example,
> "amplify", "magnify", "terrify", etc.
>
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__en.wiktionary.org_wiki_-2Dify&d=DwIFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=owI_YZl60rgj74U9tzqxcA&m=jUulcI-27ChSIukpI4uzg0LktqA5zRt9HI8Lz0JxRYU&s=o95nXSmjNMCHMbmoWeL7LildI9qwEdnusnlAOenreQ4&e=
>
> So heapify literally means "make into a heap". Not only is the name
> correct, but it is a better name for an in-place operation than either of
> the terms you give:
>
> * "build-heap" does not describe an in-place operation;
> * "make-heap" is ambiguous in whether it is in-place or not.
>
> But even if we agreed that the name needs to change to match text books
> (which text books?), since heapify is a public function, we cannot just
> change the name. We would have to keep the old name around for many, many
> years, possibly forever.
>
> ----------
> nosy: +steven.daprano
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <
> https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.python.org_issue39634&d=DwIFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=owI_YZl60rgj74U9tzqxcA&m=jUulcI-27ChSIukpI4uzg0LktqA5zRt9HI8Lz0JxRYU&s=kE5QfuakDzLUOPpeWAGCf7Z0zJeeeC1iDUSj-bMFzrE&e=
> >
> _______________________________________
>
History
Date User Action Args
2020-02-14 22:30:28hp685setrecipients: + hp685, steven.daprano
2020-02-14 22:30:28hp685linkissue39634 messages
2020-02-14 22:30:28hp685create