shengulong

dict1={"a":1,"b":2,"22a":44}

JS: dict1.a 和 dict1["a"]都可以

python:只能使用dict1["a"]

 

另外在JS中,不允许使用dict1.22a这种以数字开头的key,所有此时只能使用dict1["22a"]这种写法,这种问题主要出现在react做为前端、python做为后端时的情况下。python提供给前端的接口里还有这种不标准的key命名

 

参考:https://segmentfault.com/q/1010000002639901

分类:

技术点:

相关文章:

  • 2021-07-01
  • 2021-12-21
  • 2021-07-15
  • 2021-06-19
  • 2021-12-22
  • 2021-12-22
  • 2021-12-22
猜你喜欢
  • 2021-08-25
  • 2021-08-31
  • 2021-10-16
  • 2021-09-14
  • 2021-09-10
  • 2021-04-17
  • 2021-12-22
  • 2021-04-02
相关资源
相似解决方案