what's the usage of __traceback_hide__
<p>I have seen this line of code in some functions</p>

<pre><code>__traceback_hide__ = True 
</code></pre>

<p>What does it do? It seems like its trying to suppress the error traceback. In what situations should the traceback be hidden?</p>

<p><code>__tracebackhide__</code> can be set to hide a function from the traceback when using PyTest. <code>__traceback_hide__</code> appears to be used in the Python Paste package for the same purpose.</p>

<p>Here's what the <a href="http://pythonpaste.org/modules/exceptions.html#module-paste.exceptions.collector" rel="nofollow">paste.exceptions.collector</a> documentation has to say about it:</p>

<blockquote>
  <p>If set and true, this indicates that the frame should be hidden from abbreviated tracebacks. This way you can hide some of the complexity of the larger framework and let the user focus on their own errors.</p>
  
  <p>By setting it to 'before', all frames before this one will be thrown away. By setting it to 'after' then all frames after this will be thrown away until 'reset' is found. In each case the frame where it is set is included, unless you append '_and_this' to the value (e.g., 'before_and_this').</p>
  
  <p>Note that formatters will ignore this entirely if the frame that contains the error wouldnât normally be shown according to these rules.</p>
</blockquote>

<p>And the <a href="http://doc.pytest.org/en/latest/example/simple.html#writing-well-integrated-assertion-helpers" rel="nofollow">PyTest documentation</a> on its similar <code>__tracebackhide__</code>:</p>

<blockquote>
  <p>If you have a test helper function called from a test you can use the pytest.fail marker to fail a test with a certain message. The test support function will not show up in the traceback if you set the __tracebackhide__ option somewhere in the helper function.</p>
</blockquote>

<p>So basically, they are to avoid cluttering your tracebacks with test helper functions or other functions that you know aren't part of the problem that you are trying to debug.</p>

python