[Python-ideas] Suggested MapView object (Re: __len__() for map())
greg.ewing at canterbury.ac.nz
Tue Dec 11 17:31:03 EST 2018
Steven D'Aprano wrote:
> I suggest we provide a separate mapview() type that offers only the lazy
> sequence API, without trying to be an iterator at the same time.
Then we would be back to the bad old days of having two functions
that do almost exactly the same thing. My suggestion was made in
the interests of moving the language in the direction of having
less warts, rather than adding more or moving the existing ones
I acknowledge that the dual interface is itself a bit wartish,
but it's purely for backwards compatibility, so it could be
deprecated and eventually removed if desired.
More information about the Python-ideas