title: Handle exception in __init__
body: <p>Is it fine to raise an exception in <code>__init__</code> in python? I have this piece of code:</p>
  
  <pre><code>class VersionManager(object):
      def __init__(self, path):
          self._path = path
          if not os.path.exists(path): os.mkdir(path)
          myfunction(path)
  </code></pre>
  
  <p>The second line can potentially result in an exception. In that case the object will not be init'ed properly. Is there a better way to handle situations where code in <code>__init__</code> might throw an exception?</p>
  
  <p><strong>EDIT</strong>
  Added a call to a function after <code>os.mkdir</code> <br>
  Added a check to see if directory exists</p>