0

isn't it logical?

[] is a mutable data structure while () is a immutable data structure

It has been posted as bug on http://bugs.python.org/issue23275 with a lot of discussion. I have raised the same point there but am curious why nobody raised this point before. Am I missing something here?

BartoszKP
  • 34,786
  • 15
  • 102
  • 130
comiventor
  • 3,922
  • 5
  • 50
  • 77
  • 1
    See http://stackoverflow.com/questions/30147165/how-come-raises-no-error – Alex Riley May 27 '15 at 12:41
  • Also http://stackoverflow.com/questions/29870019/why-is-it-valid-to-assign-to-an-empty-list-but-not-to-an-empty-tuple – Alex Riley May 27 '15 at 12:41
  • Please don't add tags to the question title - this is done automatically. – BartoszKP May 27 '15 at 12:41
  • I think this seems to be logical correct. You can assign a limited type to a more unlimited type. So it's a little like containers float can contain int and so on if we look on simple data types... mutable can hold immutable but not the way around. More general datatypes can be assigned to smaller ones. This would be my mindset. – wenzul May 27 '15 at 12:44

0 Answers0