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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com