title: Calling a method within another method in the same class in Python
body: <p>In the following class, I would expect the output to be:</p>
  
  <pre><code>here
  generating spike
  generate spike 2
  some data
  </code></pre>
  
  <p>Instead, the output is:</p>
  
  <pre><code>here
  generating spike
  </code></pre>
  
  <p>I don't know what I'm doing wrong. Please help.</p>
  
  <p>Class:</p>
  
  <pre><code>class InjectAnomaly:
      def generate_drop(self):
          print('generate drop 2')
          print(self.data)
  
          return
  
      def generate_spike(self):
          print('generate spike 2')
          print(self.data)
  
          return
  
      def inject(self):
          spike_or_drop = self.type
  
          if spike_or_drop is 'spike':
              print('Generating spike')
              self.generate_spike() 
  
          elif spike_or_drop is 'drop':
              print('Generating drop')
              self.generate_drop()
  
      def __init__(self, type, data):
          self.type = type
          self.data = data
  
          if self.type is not 'none':
              print('here')
              self.inject()
  
  </code></pre>
  
  <p>I've seen other questions on Stack Overflow addressing the same thing, and I don't know what I am doing differently.
  inject() gets called, then it identifies the spike</p>