Brett Cannon, 06.04.2011 19:40: > On Tue, Apr 5, 2011 at 05:01, Nick Coghlan wrote: >> However, there actually *is* a significant semantic discrepancy in the >> heapq case, which is that py_heapq is duck-typed, while c_heapq is >> not: >> >> TypeError: heap argument must be a list > > That's true. I will re-word it to point that out. The example code still > shows it, I just didn't explicitly state that in the example. Assuming there always is an "equivalent" Python implementation anyway, what about using that as a fallback for input types that the C implementation cannot deal with? Or would it be a larger surprise for users if the code ran slower when passing in a custom type than if it throws an exception instead? Stefan
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4