On Thu, Apr 7, 2011 at 3:15 PM, Stefan Behnel <stefan...@behnel.de> wrote: > 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?
It often isn't practical - the internal structures of the two don't necessarily play nicely together. It's an interesting idea for heapq in particular, though. (The C module fairly could easily alias the Python versions with underscore prefixes, then fallback to those instead of raising an error if PyList_CheckExact fails). Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ 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