Python Forum
iterating sets and frozensets
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iterating sets and frozensets
#1
i have been creating then iterating some large sets. i created them by filling a set with a large sequence of numbers from range() using a comprehension. then i iterate the sets in another comprehension. even for a large size like 8192, the items were iterated in the same order as the original sequence. is this something that should be expected?

i'd like to know if there is a function that can extract a single arbitrary item from a set. would next() be able to do this?

edit:

sorry, my thoughts got mixed up on that. it should be from a frozenset.
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
  sets are unhashable Skaperen 6 3,370 Aug-09-2018, 12:29 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