Hacker News new | ask | show | jobs
by chisophugis 4510 days ago
Appears to need a bit more robustification.

    >>> simplify(sqrt(x^2))
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/functions/elementary/miscellaneous.py", line 110, in sqrt
        return C.Pow(arg, S.Half)
      File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/cache.py", line 93, in wrapper
        r = func(*args, **kw_args)
      File "/base/data/home/apps/s~sympy-live-hrd/43.373169527249054993/sympy/sympy/core/power.py", line 119, in __new__
        obj = b._eval_power(e)
    AttributeError: 'Not' object has no attribute '_eval_power'
3 comments

    x^2
in Python is x XOR 2 :) You probably want

    x**2
You are using live.sympy.org. It has its own issues. The library itself works well when ran from normal python prompt.
Are you sure it's x^2 and not x2? Perhaps sympy does extra foo to feel more like mathematics.