Changes between Initial Version and Version 1 of Ticket #24757, comment 2


Ignore:
Timestamp:
02/22/18 15:15:45 (4 years ago)
Author:
embray
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24757, comment 2

    initial v1  
    11There's been lots of debate about this in the Python community in the past.
    22
    3 Of course finiteness is important.  If you do something like `list(infinite_generator)` your code will hang forever, or until you blow up with a `MemoryError`.  As I wrote, one can only do so much to protect users from that--it's not 100% possible in all cases, but I certainly prefer to as much as possible.  I've definitely seen cases where just blindly assuming all iterables will be finite can blow up in one's face.
     3Of course finiteness is important.  If you do something like `list(infinite_generator)` your code will hang forever, or until you blow up with a `MemoryError`.  As I wrote, one can only do so much to protect users from that--it's not 100% possible in all cases--but I certainly prefer to as much as possible.  I've definitely seen cases where just blindly assuming all iterables will be finite can blow up in one's face.