[removed] using tuples as dictionary keys

前端 未结 4 2005
-上瘾入骨i
-上瘾入骨i 2021-02-06 23:21

I have a situation where I want to create a mapping from a tuple to an integer. In python, I would simply use a tuple (a,b) as the key to a dictionary,

Does

4条回答
  •  没有蜡笔的小新
    2021-02-06 23:28

    the most simple and "natural" way to achieve something similar is by using multidimensional arrays, like this:

    var my_map = [["blah","blah","bla"],
                  ["foo", "bla", 8],
                  [324, 2345, 235],
                  [true, false, "whatever..."]];
    

提交回复
热议问题