> Date: Mon, 25 Apr 2005 08:51:17 -0500 > From: Mike Meyer <[EMAIL PROTECTED]>
> Which means that the real rule should be always use generator expressions, > unless you *know* the expression will always fit in memory. > Which leads to the obvious question of why the exception. <code> >>> l = [(1, 2), ('a', 'b'), (3, 2), (23, 32)] >>> l [(1, 2), ('a', 'b'), (3, 2), (23, 32)] </code> This screen dump of the object is quite useful to me. <code> >>> r = reversed(l) >>> r <listreverseiterator object at 0x009D2B90> </code> This screen dump of the object is less useful to me. >From a pure programming point of view it's not a sufficient reason to keep list comprehensions, especially as the interpreter shell could be massaged into giving more output, but right here right now it's a lot easier to read the former than the latter IMHO. (That is assuming I'm right in assuming functions like "reversed" are generator expressions). Mark ----------------------------------------------------------------------- The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful. If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary companies. ----------------------------------------------------------------------- -- http://mail.python.org/mailman/listinfo/python-list