title: In Python, why do warnings not appear when using `eval`?
body: <p>The following code prints a warning, as expected:</p>
  
  <pre><code>&gt;&gt;&gt; import warnings
  &gt;&gt;&gt; def f():
  ...     warnings.warn('Deprecated', DeprecationWarning)
  ...     print('In function f()')
  ... 
  &gt;&gt;&gt; f()
  __main__:2: DeprecationWarning: Deprecated
  In function f()
  </code></pre>
  
  <p>However, when using <code>eval</code>, the warning message does not appear:</p>
  
  <pre><code>&gt;&gt;&gt; eval('f()')
  In function f()
  </code></pre>
  
  <p>Why do warnings behave differently in these two situations?</p>