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

Anders Hovmöller boxed at killingar.net
Wed Nov 28 11:37:39 EST 2018



> I just mentioned that porting effort for background.  I still believe
> that the actual proposal of making the arguments to a map(...) call
> accessible from Python as attributes of the map object (ditto filter,
> zip, etc.) is useful in its own right, rather than just having this
> completely opaque iterator.

+1.  Throwing away information is almost always a bad idea. That was fixed with classes and kwargs in 3.6 which removes a lot of fiddle workarounds for example. 

Throwing away data needlessly is also why 2to3, baron, Parso and probably many more had to reimplement a python parser instead of using the built in. 

We should have information preservation and transparency be general design goals imo. Not because we can see the obvious use now but because it keeps the door open to discover uses later. 

/ Anders


More information about the Python-ideas mailing list