Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
popping an iterator
#11
Again, given that iterators include generators, how exactly would reversing them work?
Reply
#12
(Oct-02-2021, 05:55 PM)ndc85430 Wrote: Also, what would you think should happen if the iterator was infinitely long?

what if the value passed to range() was extraordinarily high, such as 2**64? i know i would not take much memory, but what about time? we do make faster computers, but we still manage to run out of it on a regular basis. i think we know what to with software that is running and producing no results.
reversing an iterator has its limits. memory may be a frequent one. time may also be. imagine a computer so larg that it takes hours to clear memory to all zeroes.

imagine a new type of iterator with a method to access data from each end? imagine one that supports random access.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Why not use len(alist) in an iterator? Pedroski55 5 1,472 Jun-27-2024, 02:49 PM
Last Post: snippsat
  prime numbers with iterator and generator cametan_001 8 3,680 Dec-17-2022, 02:41 PM
Last Post: cametan_001
  resetting an iterator to full Skaperen 7 11,321 Feb-20-2022, 11:11 PM
Last Post: Skaperen
  q re glob.iglob iterator and close jimr 2 3,246 Aug-23-2021, 10:14 PM
Last Post: perfringo
  Problem with an iterator grimm1111 9 6,127 Feb-06-2021, 09:22 PM
Last Post: grimm1111
  Multi-class iterator Pedroski55 2 3,108 Jan-02-2021, 12:29 AM
Last Post: Pedroski55
  is a str object a valid iterator? Skaperen 6 7,432 Jan-27-2020, 08:44 PM
Last Post: Skaperen
  discard one from an iterator Skaperen 1 2,615 Dec-29-2019, 11:02 PM
Last Post: ichabod801
  looking for a sprcil iterator Skaperen 7 4,805 Jun-13-2019, 01:40 AM
Last Post: Clunk_Head
  last pass of for x in iterator: Skaperen 13 7,949 May-20-2019, 10:05 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020