title: Conventions on creating constants in Python
body: <p>I am writing an application which needs to find out the schema of a database, across engines. To that end, I am writing a small database adapter using Python. I decided to first write a base class that outlines the functionality I need, and then implement it using classes that inherit from this base. Along the way, I need to implement some constants which need to be accessible across all these classes. Some of these constants need to be combined using C-style bitwise OR.</p>
  
  <p>My question is, </p>
  
  <ol>
  <li>what is the standard way of sharing such constants?</li>
  <li>what is the right way to create constants that can be combined? I am referring to <code>MAP_FIXED | MAP_FILE | MAP_SHARED</code> style code that C allows.</li>
  </ol>
  
  <p>For the former, I came across threads where all the constants were put into a module first. For the latter, I briefly thought of using a dict of booleans. Both of these seemed too unwieldly. I imagine that this is a fairly common requirement, and think some good way must indeed exist!</p>