[issue37435] builtin map iterator should provide __length_hint__

2019-06-27 Thread Nicholas Musolino


Change by Nicholas Musolino :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37435] builtin map iterator should provide __length_hint__

2019-06-27 Thread Nicholas Musolino


Nicholas Musolino  added the comment:

Thanks, Serihy.  I can close this issue.

I actually have been looking at this problem for some time, and created a 
patch, but don't what the "length transparency issues" that led to #26828 being 
closed.  

Do you think I should close this and comment on the original issue?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37435] builtin map iterator should provide __length_hint__

2019-06-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a duplicate of issue26828.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37435] builtin map iterator should provide __length_hint__

2019-06-27 Thread Nicholas Musolino


Change by Nicholas Musolino :


--
keywords: +patch
pull_requests: +14248
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14432

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37435] builtin map iterator should provide __length_hint__

2019-06-27 Thread Nicholas Musolino


New submission from Nicholas Musolino :

The builtin `map` function takes one or more user-supplied iterators, and 
returns an iterator.

When all the user-supplied iterator arguments to `map` provide a valid length 
hint (according to the PEP 424 length hint protocol), the iterator returned by 
`map` should provide a length hint.  

I suggest the following behavior:  when all the iterator arguments provide a 
valid length hint, the map iterator should return the minimum value among all 
length hint values, because it stops upon exhaustion of the shortest input 
iterator.

If any user-supplied iterator does *not* provide a length hint according to the 
PEP 424 protocol, the map iterator should return the `NotImplemented` 
singleton, in accordance with the protocol.

When the evaluation of `__length_hint__()` for a user-supplied iterator raises 
an exception, the exception should be propagated by the map iterator's 
`__length_hint__()` method.

--
components: Interpreter Core
messages: 346772
nosy: nmusolino
priority: normal
severity: normal
status: open
title: builtin map iterator should provide __length_hint__
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com