Is there a Python equivalent to Ruby symbols?

后端 未结 5 1085
时光说笑
时光说笑 2020-12-13 23:39

Is there a Python equivalent to Ruby symbols?

  • If so then what is it?

  • If not then are we stuck with using strings as our

5条回答
  •  时光说笑
    2020-12-14 00:04

    1. No, there is no equivalent.
    2. No you can use every hashable object as dictionary key.

提交回复
热议问题