[Python-ideas] Extended "break" "continue" in "for ... in" block.
Simon Sapin
simon.sapin at kozea.fr
Thu May 24 13:05:15 CEST 2012
More information about the Python-ideas mailing list
Thu May 24 13:05:15 CEST 2012
- Previous message: [Python-ideas] Extended "break" "continue" in "for ... in" block.
- Next message: [Python-ideas] Extended "break" "continue" in "for ... in" block.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Le 24/05/2012 12:47, 海韵 a écrit :
> we can say there is a generator ("__g = iter(<container>)")
> [...]
> "continue <test>" is equiv to "__g.send(<test>)".
Hi,
iter() returns an iterator, not a generator.
All generators are iterators, but not all iterators are generators: an
iterator may not have a .send() method.
How would "continue something_that_is_not_None" behave with an iterator
without a .send() method?
Regards,
--
Simon Sapin
- Previous message: [Python-ideas] Extended "break" "continue" in "for ... in" block.
- Next message: [Python-ideas] Extended "break" "continue" in "for ... in" block.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list