On Sun, Jul 15, 2012 at 1:36 PM, Antoine Pitrou <solip...@pitrou.net> wrote: > On Sun, 15 Jul 2012 18:47:38 +1000 > Nick Coghlan <ncogh...@gmail.com> wrote: >> I'm not seeing the value in returning None over 0 for the don't know >> case - it just makes the API harder to use. > > The point is that 0 is a legitimate value for a length hint. Simple > implementations of __length_hint__ will start returning 0 as a > legitimate value and you will wrongly interpret that as "don't know", > which kinds of defeat the purpose of __length-hint__ ;)
I agree with this: giving special meaning to what's already a valid length value seems wrong. Mark _______________________________________________ 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