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 ncoghlan
Recipients Trundle, daniel.urban, eric.araujo, ncoghlan, pitrou, rhettinger
Date 2011-04-05.12:24:26
SpamBayes Score 6.547293e-10
Marked as misclassified No
Message-id <>
I may have found another use case for this functionality. Currently, the Python code in accepts arbitrary sequences (that are sufficiently compatible with the Sequence ABC), but the C code in _heapq only permits use of a concrete list.

The two currently available approaches to address that discrepancy are:
1. Use PyObject_* calls instead of PyList_* calls throughout the code (yuck, we'd be making the common case significantly worse in the name of semantic purity)
2. Sprinkle type checks throughout the _heapq code to decide whether or not to call the concrete APIs or their abstract equivalents

The extensive use of the PyList macro API in _heapq means that a little bit of 2 might still be necessary even if the concrete API was updated as Raymond suggests, but I think there would be value in changing the meaning of the concrete APIs to include falling back to the abstract APIs if the type assumption is incorrect.
Date User Action Args
2011-04-05 12:24:27ncoghlansetrecipients: + ncoghlan, rhettinger, pitrou, eric.araujo, Trundle, daniel.urban
2011-04-05 12:24:27ncoghlansetmessageid: <>
2011-04-05 12:24:26ncoghlanlinkissue10977 messages
2011-04-05 12:24:26ncoghlancreate