title: How to make custom data class subscriptable
body: <p>Consider this data class derived from the <a href="https://pypi.org/project/pydantic/" rel="noreferrer"><code>pydantic</code></a> package:</p>
  <pre><code>from typing import List
  from pydantic import BaseModel 
  class Bucket(BaseModel):
      setting: List[str]
      fight_1: List[int]
      cause_1: List[str]
  </code></pre>
  <p>let <code>my_bucket</code> be an instance of <code>Bucket</code>:</p>
  <pre><code>my_bucket = Bucket(setting=['some_value'], fight_1=[0], cause_1=['other_value'])
  </code></pre>
  <p>basically I would like to be able to do</p>
  <pre><code>my_bucket['setting']                                                                                                         
  </code></pre>
  <p>and get back <code>['some_value']</code>, but instead I get:</p>
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-18-cacbdc1698e9&gt; in &lt;module&gt;
  ----&gt; 1 my_bucket['setting']
  
  TypeError: 'Bucket' object is not subscriptable
  </code></pre>