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
  prime numbers with iterator and generator cametan_001 8 1,876 Dec-17-2022, 02:41 PM
Last Post: cametan_001
  resetting an iterator to full Skaperen 7 7,006 Feb-20-2022, 11:11 PM
Last Post: Skaperen
  q re glob.iglob iterator and close jimr 2 2,241 Aug-23-2021, 10:14 PM
Last Post: perfringo
  Problem with an iterator grimm1111 9 4,348 Feb-06-2021, 09:22 PM
Last Post: grimm1111
  Multi-class iterator Pedroski55 2 2,397 Jan-02-2021, 12:29 AM
Last Post: Pedroski55
  is a str object a valid iterator? Skaperen 6 5,652 Jan-27-2020, 08:44 PM
Last Post: Skaperen
  discard one from an iterator Skaperen 1 1,997 Dec-29-2019, 11:02 PM
Last Post: ichabod801
  how do i pass duplicates in my range iterator? pseudo 3 2,365 Dec-18-2019, 03:01 PM
Last Post: ichabod801
  looking for a sprcil iterator Skaperen 7 3,370 Jun-13-2019, 01:40 AM
Last Post: Clunk_Head
  last pass of for x in iterator: Skaperen 13 5,897 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