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/120989.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 hintLennart Regebro regebro at gmail.com
Tue Jul 17 16:02:05 CEST 2012
On Sun, Jul 15, 2012 at 1:28 AM, Alexandre Zani
<alexandre.zani at gmail.com> wrote:
> I'm +1 on not having a public API for this. Ultimately the contract
> for a length hint will depend heavily upon what you need it for. Some
> applications would require a length hint to be an "at least" others an
> "at most" and others something else entirely. Given that the contract
> here appears to be >=0, I don't think the length hint is particularly
> useful to the public at large.

Other possible related uses could be to get an approximate number of
results for a query without having to actually go through the whole
query, useful for databases and search engines. But then you *do* want
__len__ as well, so that also doesn't fit with the current PEP.

But maybe that's a completely different usecase, even though it seems
related to me?

//Lennart
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