title: How should I choose between using instance vs. class attributes?
body: <p>I tried this example code:</p>
  <pre><code>class testclass:
      classvar = 'its classvariable LITERAL'
      def __init__(self,x,y):
          self.z = x
          self.classvar = 'its initvariable LITERAL'
          
          self.test()
      
      def test(self):
          print('class var',testclass.classvar)
          print('instance var',self.classvar)
          
  if __name__ == '__main__':
      x = testclass(2,3)
  </code></pre>
  <p>I need some clarification. In both cases, I'm able to access the class attribute and instance in the <code>test</code> method.</p>
  <p>So, suppose if I have to define a literal that needs to be used across all function, which would be the better way to define it: an instance attribute or a class attribute?</p>