On Tue, Nov 21, 2017 at 04:56:27PM -0600, Nick Timkovich wrote:
On Tue, Nov 21, 2017 at 4:16 PM, Sven R. Kunze firstname.lastname@example.org wrote:
Maybe, that suffices: https://pypi.python.org/pypi/xheap
I still think the heapq.heap* functions are atrocious and they should immediately be packaged with *no additional features* into a stdlib object for reasons along the line of https://mail.python.org/pipermail/python-ideas/2017-October/047514.html
I think you pasted the wrong URL. That link is about pip, and the discoverability of third-party libraries. It says nothing about why functions are "atrocious" and why wrapping them into an object is better.
But generally, Python's APIs are not "pure object oriented" in the Java sense, and we don't needlessly create objects just for the sake of ensuring everything is an object. Functions are fine too, and if the only difference between a function and method is the syntax you use to call it:
then that's a difference that makes no difference, and there is no advantage to using an object wrapper.
for a perspective on how the emphasis on objects is harmful.
What advantage is there to making the heap functions into Heap methods?