Re:Comprehensive Python Cheatsheet (2018)
by vram22 on Monday February 04, 2019 @10:57AM
(#19077326)
In the section "Inline -> Comprehension", isn't this:
really a generator expression?
[ Parent
| on HN ]
Re:Comprehensive Python Cheatsheet (2018)
by pizzaburek on Monday February 04, 2019 @11:27AM
(#19077610)
Yes, although there is a saying that "every generator is an iterator, but not every iterator is a generator". But then again generator has a bunch of methods (close, gi_frame, gi_yieldfrom, throw, gi_code, gi_running, send) that iterators don't have... I really don't know if <iter> is correct enough here, or should I use <genr> (that I don't use anywhere else and could be confusing).