title: How do I use tuples as key for __setitem__
body: <p>I'm trying to assign values to my nested list using the <strong>setitems</strong> method. However, since Python only allows one key in <strong>setitems</strong>, I'm having some trouble.</p>
  <pre><code>class Place:
      def __init__(self, x: int, y: int):
          self.x = x
          self.y = y
  
  class ABC(Place):
      def __init__(self):
          self.nestedlist = [[&quot;&quot;, &quot;&quot;, &quot;&quot;], [&quot;&quot;, &quot;&quot;, &quot;&quot;], [&quot;&quot;, &quot;&quot;, &quot;&quot;]]
      def __setitem__(self, key, value):
          self.nestedlist[[x][y]] = value
  </code></pre>
  <p>My place class defines the index of my value within the nested list &amp; it's mandatory to be used for my task. What I want to do is:</p>
  <p>Input:</p>
  <pre><code>myobject = ABC()
  myplace = Place(0,2)
  myobject[myplace] = 9
  </code></pre>
  <p>Output:</p>
  <pre><code>nestedlist = [[&quot;&quot;, &quot;&quot;, 9], [&quot;&quot;, &quot;&quot;, &quot;&quot;], [&quot;&quot;, &quot;&quot;, &quot;&quot;]]
  </code></pre>