title: Array of tokens
body: <p>I was following the <a href="https://www.youtube.com/watch?v=Eythq9848Fg&amp;list=PLZQftyCk7_SdoVexSmwy_tBgs7P0b97yD&amp;index=1" rel="nofollow noreferrer">video</a></p>
  <pre><code>TT_INT = 'INT'
  TT_FLOAT = 'FLOAT'
  TT_PLUS = 'PLUS'
  TT_MINUS = 'MINUS'
  TT_MUL = 'MUL'
  TT_DIV = 'DIV'
  TT_LPAREN = 'LPAREN'
  TT_RPAREN = 'RPAREN'
  
  ####################################
  # TOKEN
  ####################################
  
  class Token:
      def __init__(self, type_, value=None):
          self.type = type_
          self.value = value
  
      def __repr__(self):
          if self.value: return f'{self.type}:{self.value}'
          return f'{self.type}'
  </code></pre>
  <p>He was calling <code>Token</code> like this</p>
  <pre><code>Token[TT_DIV]
  </code></pre>
  <p>I got an error. He initialized a class called Token. He declared twice variable <code>type_</code> and <code>value</code>. Then, in <code>__repr__</code> method he checked if <code>value</code> (Actually it is like checking boolean. But, value isn't boolean. So, what is that? What is happening write here. And, I know it will always return true) Then, he returned <code>type:value</code>. Then, <code>type</code>. Now, the my question is class <code>Token</code> isn't returning any type of array. So, why he is calling <code>Token</code> by <code>Token[TT_DIV]</code>(or something else). It is outta my mind.</p>
  <p>I could directly use <code>TT_DIV</code> or something else to call that <code>value</code>. But, I want to know why he did it?</p>