From 956e4f792fbaea5aca938d6ed0d66bdc7c7e401b Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Thu, 20 May 2004 22:59:26 +0000 Subject: [PATCH] Clarify when iter() is first called in generator expressions. --- Doc/whatsnew/whatsnew24.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/whatsnew/whatsnew24.tex b/Doc/whatsnew/whatsnew24.tex index f5890a18fc0..1db43035a79 100644 --- a/Doc/whatsnew/whatsnew24.tex +++ b/Doc/whatsnew/whatsnew24.tex @@ -105,13 +105,13 @@ friendly than equivalent list comprehensions. is equivalent to: \begin{verbatim} - def _generator(exp): + def __gen(exp): for var1 in exp: for var2 in exp2: if exp3: yield tgtexp - g = _generator(exp1) - del _generator + g = __gen(iter(exp1)) + del __gen \end{verbatim} The advantage over full generator definitions is in economy of