Docs: a brief note in the sets tutorial about order (GH-145984)
(cherry picked from commit
4f5e79805ebcaa0d3ba1677694d4120a9e8f4513)
Docs: a brief note in the sets tut about order
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
create an empty set you have to use ``set()``, not ``{}``; the latter creates an
empty dictionary, a data structure that we discuss in the next section.
+Because sets are unordered, iterating over them or printing them can
+produce the elements in a different order than you expect.
+
Here is a brief demonstration::
>>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}