[Python-ideas] Adding a thin wrapper class around the functions in stdlib.heapq

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Nov 22 17:02:21 EST 2017


Chris Angelico wrote:
> Yeah but if it's wrapping an existing list, it's not really
> constructing a new object.

That depends on what you consider the object to be. There
are existing examples of objects that wrap other objects
and mutate them, e.g. TextIOWrapper.

If it would make anyone happier, there could be two classes,
Heap and HeapWrapper (with one probably being implemented
as a subclass of the other).

-- 
Greg


More information about the Python-ideas mailing list