Comment #3 on issue 2421 by smi...@gmail.com: python(expr) issues
http://code.google.com/p/sympy/issues/detail?id=2421

The problem in the last comment is that you couldn't run that as python code and have it work.

Also, there is a strange error when trying to S to srepr form of piecewise:

 >>> q
    Piecewise((1, [0, 1)))
    >>> srepr(q)
"Function('Piecewise')(Function('ExprCondPair')(Integer(1), Interval(Integer(0), Integer(1), False, True)))"
    >>> S(_)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "sympy/core/basic.py", line 501, in __repr__
        return sstr(self)
      File "sympy/printing/str.py", line 439, in sstr
        s = p.doprint(expr)
      File "sympy/printing/printer.py", line 224, in doprint
        return self._str(self._print(expr))
      File "sympy/printing/printer.py", line 248, in _print
        return getattr(self, printmethod)(expr, *args)
      File "sympy/printing/str.py", line 105, in _print_Function
        return expr.func.__name__ + "(%s)"%self.stringify(expr.args, ", ")
      File "sympy/printing/str.py", line 28, in stringify
        return sep.join([self.parenthesize(item, level) for item in args])
      File "sympy/printing/str.py", line 25, in parenthesize
        return self._print(item)
      File "sympy/printing/printer.py", line 248, in _print
        return getattr(self, printmethod)(expr, *args)
      File "sympy/printing/str.py", line 99, in _print_ExprCondPair
        return '(%s, %s)' % (expr.expr, expr.cond)
    AttributeError: 'ExprCondPair' object has no attribute 'expr'

It does have that attribute. I don't know why the error is raising.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to