title: python undefined variable
body: <p>Why the variable freq is not defined in the method update?
  I am calling the method candle on init and this method contains freq?</p>
  
  <pre><code>class candle:
      def __init__(self):
          self.freq = None
          self.open_price = None
          self.high_price = None
          self.low_price = None
          self.last_price = None
          self.volume = 0
  
      def addTick(self,tick):
          if self.open_price is None:
              self.open_price = tick.price
          if self.high_price is None or tick.price &gt;self.high_price:
              self.high_price = tick.price
          if self.low_price is None or tick.price &lt;self.low_price:
              self.low_price = tick.price   
          self.last_price = tick.price
          self.volume = self.volume +1
  
  
      def update(self,tick):
          self.candle.addTick(tick)
          if keyfunc(current_time,freq) != reference_timestamp[freq]:
              self.notify(self.candle)
              self.candle = candle()
  </code></pre>