Why doesn't Python have static variables?

后端 未结 9 2475
暗喜
暗喜 2020-11-27 14:48

There is a questions asking how to simulate static variables in python.

Also, on the web one can find many different solutions to create static variables. (Though I

9条回答
  •  暖寄归人
    2020-11-27 15:19

    It's a design choice.

    I'm assuming Guido thinks you don't need them very often, and you never really need them: you can always just use a global variable and tell everyone to keep their greasy paws offa' your variable ;-)

提交回复
热议问题