E. Madison Bray wrote:
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.
But it will only help if the user passes a map object in particular, and not some other kind of iterator. Also it won't help if the inputs to the map are themselves iterators that aren't amenable to inspection. This smells like exposing an implementation detail of your function in its API. I don't see how it would help with your Sage port either, since the original code only got the result of the mapping and wouldn't have been able to inspect the underlying iterables. I wonder whether it's too late to redefine map() so that it returns a view object instead of an iterator, as was done when merging dict.{items, iter_items} etc. Alternatively, add a mapped() bultin that returns a view. -- Greg _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/