By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,662 Members | 1,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,662 IT Pros & Developers. It's quick & easy.

unordered set in python...question about how the items within it are displayed

P: 1
since sets in python are unordered collection,a set does't show the items it contains in the same order they have added. is it however safe to assume that the items will be displayed always in the same order?? eg.
i create the following set
test = set['regina', 'paul', 12, 'cool' ]

if i want to show the items in test
test
i may get the following output: set(['cool', 12, 'paul', 'regina'])
does it mean the items will be showed from now on in that same order?
thanks folks
Jun 27 '12 #1
Share this Question
Share on Google+
1 Reply

bvdet
Expert Mod 2.5K+
P: 2,851
Probably in the short term, but there is no guarantee the order will be the same in other versions of Python.
Jun 28 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.