On Wed, Nov 28, 2018 at 04:04:33PM +0100, E. Madison Bray wrote:

> That effort is already mostly done and adding a helper function would
> not have worked as users *passing* map(...) as an argument to some
> function just expect it to work.

Ah, that's what I was missing.

But... surely the function will still work if they pass an opaque 
iterator *other* than map() and/or filter?

it = (func(x) for x in something if condition(x))
some_sage_function(it)


You surely don't expect to be able to peer inside every and any iterator
that you are given? So if you have to handle the opaque iterator case 
anyway, how is it *worse* when the user passes map() or filter() instead 
of a generator like the above?


> 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.

Perhaps...

I *want* to agree with this, but I'm having trouble thinking of when and 
how it would be useful. Some concrete examples would help justify it.


-- 
Steve
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to