title: Proper use of class constants in Python
body: <p>This question specifically relates to the use of the class constants <code>ABOVE</code> and <code>BELOW</code> in the sample code below.</p>
  
  <p>I have a few different classes in different modules that look like this:</p>
  
  <pre><code>class MyClass(object):
      ABOVE = 1
      BELOW = 0
  
      def __init__(self):
          self.my_numbers = [1,2,3,4,5]
  
      def find_thing_in_direction(self, direction, cutoff):
          if direction == self.ABOVE:
              return [n for n in self.my_numbers if n &gt; cutoff]
          else:
              return [n for n in self.my_numbers if n &lt; cutoff]
  
  
  my_class = MyClass()
  my_var = my_class.find_thing_in_direction(MyClass.ABOVE, 3)
  </code></pre>
  
  <p>If I have a handful of classes scattered across different modules that each have their own <code>ABOVE</code> and <code>BELOW</code>, should I extract these constants to somewhere, or is it better to keep the constants within their own classes?</p>
  
  <p>Is there a more Pythonic way to do this instead of using these class constants?</p>