Why isn't 'list' a reserved word in Python?

后端 未结 4 1306
無奈伤痛
無奈伤痛 2020-12-11 20:14

I just got bit by a bug that would have been prevented if list were a reserved word in Python. (Dumbery on my part, to be sure.)

So why isn\'t list (or

4条回答
  •  情歌与酒
    2020-12-11 20:39

    Probably for the same reason for which classes dont have private attributes. This is spirit of Python.

提交回复
热议问题