New submission from Nick Coghlan <ncogh...@gmail.com>: The language reference is currently silent as to whether or not an iterator's next() method is looked up on every pass around a for loop, or whether it is OK for an implementation to look the method up once at the start of the loop, cache the result and call it again each time around the loop without doing the lookup again.
The language reference should require implementations to follow CPython's behaviour in this respect: the method should be looked up again on each pass around the loop. As per this email on python-ideas: http://mail.python.org/pipermail/python-ideas/2009-April/004083.html ---------- assignee: georg.brandl components: Documentation messages: 85883 nosy: georg.brandl, ncoghlan priority: normal severity: normal status: open title: Language reference is ambiguous regarding next() method lookup type: behavior _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5739> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com