Re: [Python-Dev] Idea: __length_hint__ wrapper in itertools

2015-02-21 Thread Nick Coghlan
On 20 February 2015 at 03:15, Carlos Pita wrote: > Hi all, > > python now supports the __length_hint__ method but not for every use > case that could potentially benefit from it, v.g.: > > 1) Some common builtins like map don't set the hint. > 2) Generators. > 3) Application specific hints that, b

[Python-Dev] Idea: __length_hint__ wrapper in itertools

2015-02-20 Thread Carlos Pita
Hi all, python now supports the __length_hint__ method but not for every use case that could potentially benefit from it, v.g.: 1) Some common builtins like map don't set the hint. 2) Generators. 3) Application specific hints that, by definition, can't be predicted by a general strategy. I know