Title: PyIter_Next documentation inconsistent with implementation
Type: behavior Stage:
Components: None Versions: Python 2.5
Status: closed Resolution: duplicate
Dependencies: Superseder: segfault in for loop with evil iterator
View: 3720
Assigned To: Nosy List: benjamin.peterson, garcia
Priority: normal Keywords:

Created on 2009-01-09 14:52 by garcia, last changed 2009-01-09 19:00 by benjamin.peterson. This issue is now closed.

Messages (4)
msg79472 - (view) Author: garcia (garcia) Date: 2009-01-09 14:52
The documentation for PyIter_Next says it will raise TypeError if the 
object passed to it is not an iterator.  However, the implementation in 
abstract.c performs an assert rather than raising TypeError.  I would 
prefer if the implementation were adjusted to match the documentation 
rather than vice-versa.
msg79481 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-01-09 17:38
Closing a duplicate of #3720.
msg79488 - (view) Author: garcia (garcia) Date: 2009-01-09 18:59
Thanks for the quick response.  I see that the discussion in 3720 
implicitly involves the implementation of PyIter_Next, but the 
documentation for PyIter_Next (and its conflict with the implementation) 
is not mentioned.
msg79489 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-01-09 19:00
The reason I linked to that issue is that the proposed patch brings the
implementation inline with the documentation as you wished. :)
Date User Action Args
2009-01-09 19:00:57benjamin.petersonsetmessages: + msg79489
2009-01-09 18:59:39garciasetmessages: + msg79488
2009-01-09 17:38:08benjamin.petersonsetstatus: open -> closed
resolution: duplicate
superseder: segfault in for loop with evil iterator
messages: + msg79481
nosy: + benjamin.peterson
2009-01-09 14:52:15garciacreate