title: What does error_already_set in Boost.python do and how to handle exceptions similarly in Python C API
body: <p>I have been working on a project where I want to remove the boost dependencies and replace it with the Python C API.</p>
  
  <p>I spent some time understanding the Python C API and I saw this
  <code>catch (error_already_set const &amp;)</code></p>
  
  <p>I read the boost docs but it explains where it is used. But I want to know why it is needed and how can I achieve the same functionality using the native Python C api.</p>