title: Python class variables or @property
body: <p>I am writing a python class to store data and then another class will create an instance of that class to print different variables. Some class variables require a lot of formatting which may take multiple lines of code to get it in its "final state".</p>
  
  <p>Is it bad practice to just access the variables from outside the class with this structure?</p>
  
  <pre><code>class Data():
      def __init__(self):
          self.data = "data"
  </code></pre>
  
  <p>Or is it better practice to use an @property method to access variables?</p>
  
  <pre><code>class Data:
      @property
      def data(self):
          return "data"
  </code></pre>