A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-July/120984.html below:

[Python-Dev] PEP 0424: A method for exposing a length hint

[Python-Dev] PEP 0424: A method for exposing a length hint [Python-Dev] PEP 0424: A method for exposing a length hintMark Dickinson dickinsm at gmail.com
Tue Jul 17 09:49:26 CEST 2012
On Sun, Jul 15, 2012 at 1:36 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Sun, 15 Jul 2012 18:47:38 +1000
> Nick Coghlan <ncoghlan at 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
More information about the Python-Dev mailing list

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