title: Using decorators in classes python3
body: <p>Please help to understand how to correctly use decorators in classes.
  For example, I want to check variables before executing the class, and if it's exist run class with this variable.
  How to do this?</p>
  
  <p>My not working example :</p>
  
  <pre><code>import os,sys
  import requests
  
  
  def checkCredentials(function):
    KEY = os.environ['KEY']
    if KEY:
      print("exist")
      return KEY
    else:
      print("nope")
      sys.exit(0)
  
  
  @checkCredentials
  class StartUp(object):
  
    def __init__(self, argument1):
      self.argument1 = argument1
  
    def printstr(self):
      print(self.argument1)
  
  
  if __name__ == '__main__':
    start = StartUp()
  </code></pre>
  
  <p>My error : </p>
  
  <pre><code>python3.6 ./main.py 
  exist
  Traceback (most recent call last):
    File "./main.py", line 26, in &lt;module&gt;
      start = StartUp()
  TypeError: 'str' object is not callable
  </code></pre>