Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are Python sets not considered sequences?

Tags:

set

sequence

In the python documentation for versions 2.x it says explicitly that there are seven sequence data types. The docs go on to discuss sets and tuples some time later (on the same page), both of which are not included in the above seven. Does anyone know what exactly makes defines a sequence type? My intuited definition has sets and tuples fitting the bill quite nicely, and I haven't had any luck finding an explicit official definition.

Thanks!

like image 595
Evan Avatar asked Jan 30 '13 09:01

Evan


1 Answers

The word "sequence" implies an order, but sets are not in a specific order.

like image 124
Michael Aaron Safyan Avatar answered Oct 02 '22 16:10

Michael Aaron Safyan