Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pipelined generator
#11
(Oct-31-2023, 10:59 AM)akbarza Wrote: is there any guide about deque?
Deque is only a type in the standard library. It is documented here. You could also read this.

However, the expression I used above
item = deque(iterable, maxlen=1)[-1]
is only a trick to obtain the last element of a non empty iterable. You could replace it with a loop
for item in iterable:
    pass
akbarza likes this post
Reply


Messages In This Thread
pipelined generator - by akbarza - Oct-26-2023, 11:10 AM
RE: pipelined generator - by Gribouillis - Oct-26-2023, 12:19 PM
RE: pipelined generator - by akbarza - Oct-30-2023, 10:10 AM
RE: pipelined generator - by deanhystad - Oct-28-2023, 04:13 AM
RE: pipelined generator - by akbarza - Oct-28-2023, 08:12 AM
RE: pipelined generator - by Gribouillis - Oct-28-2023, 11:30 AM
RE: pipelined generator - by akbarza - Oct-30-2023, 10:05 AM
RE: pipelined generator - by DeaD_EyE - Oct-29-2023, 02:41 PM
RE: pipelined generator - by deanhystad - Oct-30-2023, 11:46 AM
RE: pipelined generator - by akbarza - Oct-31-2023, 10:59 AM
RE: pipelined generator - by Gribouillis - Oct-31-2023, 12:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  receive from a generator, send to a generator Skaperen 9 5,651 Feb-05-2018, 06:26 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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