Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103579

Re: Bug in Python?

From Terry Reedy <tjreedy@udel.edu>
Newsgroups comp.lang.python
Subject Re: Bug in Python?
Date 2016-02-27 06:48 -0500
Message-ID <mailman.171.1456573807.20994.python-list@python.org> (permalink)
References <56D0CCE9.2000301@mail.de> <CACL+1asoZSWcuB2fX3qLNinu8Eo1aEeEd0o+c88=3dKbbJY-eA@mail.gmail.com> <mailman.167.1456563356.20994.python-list@python.org> <56d16fff$0$1605$c3e8da3$5496439d@news.astraweb.com>

Show all headers | View raw


On 2/27/2016 4:44 AM, Steven D'Aprano wrote:
> On Sat, 27 Feb 2016 07:55 pm, Terry Reedy wrote:
>
>> In other words, when that doc says *list*, it means a *list*.
>>
>> "To create a heap, use a list initialized to [], or you can transform a
>> populated list into a heap via function heapify()."
> [...]
>> "A heap must be an instance of *list* (and not a subclass thereof).  To
>> create a heap, start with [] or transform an existing list into a heap
>> via function heapify()."
>
> I think that's a sad decision. heapq ought to be able to handle any list
> subclass, not just actual lists. Preferably it ought to handle duck-typed
> lists too, anything with a list-like interface. It is okay if the optimized
> C version only works with actual lists, and falls back to a slower Python
> version for anything else.

Propose that on the tracker, after checking previous issues.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Bug in Python? Terry Reedy <tjreedy@udel.edu> - 2016-02-27 03:55 -0500
  Re: Bug in Python? Steven D'Aprano <steve@pearwood.info> - 2016-02-27 20:44 +1100
    Re: Bug in Python? Terry Reedy <tjreedy@udel.edu> - 2016-02-27 06:48 -0500
    Re: Bug in Python? "Sven R. Kunze" <srkunze@mail.de> - 2016-02-28 11:24 +0100

csiph-web