Dear list,

I am a little confused about why Tuple can be sorted.

Suppose I have the following,

> aTuple = (9, 3, 7, 5)
> sorted(aTuple)
[3, 5, 7, 9]

Why is it ok to sort a the class tuple? If it is invariant by nature, then
wouldn't applying a function on it yield an error?

Thanks!
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to