title: Python validating class attributes
body: <p>I need to write simple Python script for validating some system ENV variables. And I can do it with simplest code like a:</p>
  <pre><code>#test.py
  
  import os
  import sys
  
  validation_errors = []
  
  min_resources_count = os.environ.get('RESOURCES_MIN')
  max_resources_count = os.environ.get('RESOURCES_MAX')
  
  if int(min_resources_count) &gt; int(max_resources_count):
    validation_errors.append('Maximum value must be greater than or equal to minimum value')
  
  if int(max_resources_count) == 0:
    validation_errors.append('Maximum value cannot be zero')
  
  ...
  # And so on...
  ...
  
  if validation_errors:
    sys.stderr.write(validation_errors) # will add some formatting
  </code></pre>
  <p>But, something inside me says that it can be written better. Maybe it can be moved inside some class, something like this:</p>
  <pre><code>class SystemEnvValidation:
    def __init__(self):
      self.min_resources_count = os.environ.get('RESOURCES_MIN')
      self.max_resources_count = os.environ.get('RESOURCES_MAX')
  
      self.validation_errors = []
  
    def max_resources_count(self):
      # place IF conditions here
      if int(self.max_resources_count) == 0:
         self.validation_errors.append('Maximum value cannot be zero')
      ...
  
   print(SystemEnvValidation().validation_errors)
  </code></pre>
  <p>So, my question is - what is the best way to implement it? Should I place it in class? Or maybe I can leave it as is? In the case of class - I am not familiar with Python classes - could you show me simple working code structure?</p>