R. David Murray added the comment:

Well, it is the case that if you substitute a list comprehension for a 
generator expression in arbitrary code, most of the time it would work but 
occasionally it wouldn't, because the runtime behavior is different (lazy 
production versus all-at-once production).  So yes, the two are not the same 
thing, and it is important to understand the differences in behavior between 
them.  Calling a generator expression a list comprehension indicates someone's 
mental model of how Python works has a couple holes in it, IMO :)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18612>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to