[Python-ideas] __len__() for map()

Steven D'Aprano steve at pearwood.info
Mon Nov 26 17:37:20 EST 2018


On Mon, Nov 26, 2018 at 02:06:52PM -0800, Michael Selik wrote:
> If you know the input is sizeable, why not check its length instead of the
> map's?

The consumer of map may not be the producer of map.

You might know that alist supports len(), but by the time I see it, I 
only see map(f, alist), not alist itself.


-- 
Steve


More information about the Python-ideas mailing list