No Sympy two-sided limits?
<p>I can't get Sympy to handle two-sided limits.  Running in a Jupyter notebook, Anaconda installation: </p>

<pre><code>from sympy import *
x = symbols('x')
limit(1/x,x,0)
</code></pre>

<p>gives an answer of <code>oo</code>.  Furthermore,</p>

<pre><code>Limit(1/x,x,0)
</code></pre>

<p>prints as a right-sided limit.  In fact, all of my two-sided limits 'pretty-print' as right-sided limits.  They seem to be evaluated that way, too. Can't find a way to force two-sided.  Of course, one could write a short program to remedy this.   </p>

<p>What am I doing wrong?</p>

<p><code>limit</code> has a fourth argument, <code>dir</code>, which specifies a direction:</p>

<pre><code>&gt;&gt;&gt; limit(1/x, x, 0, '+')
oo
&gt;&gt;&gt; limit(1/x, x, 0, '-')
-oo
&gt;&gt;&gt; limit(1/x, x, 0)
oo
</code></pre>

<p>The default is from the right. Bidirectional limits are not directly implemented yet, but you can easily check both directions. </p>

python sympy