Status: Accepted
Owner: jensen.oyvind
Labels: Type-Defect Priority-Medium Printing

New issue 1971 by jensen.oyvind: StrReprPrinter fails with TypeError
http://code.google.com/p/sympy/issues/detail?id=1971

The following script:

"""
from sympy import sstrrepr, Basic
class A(Basic):
    def _sympystr(self, p):
        return "printing A"
print sstrrepr(type(A()))
"""

fails with a TypeError:

Traceback (most recent call last):
  File "t.py", line 7, in <module>
    print sstrrepr(type(A()))
File "/home/oy/git_workingdir/sympy/sympy/printing/str.py", line 429, in sstrrepr
    s = p.doprint(expr)
File "/home/oy/git_workingdir/sympy/sympy/printing/printer.py", line 216, in doprint
    return self._str(self._print(expr))
File "/home/oy/git_workingdir/sympy/sympy/printing/printer.py", line 232, in _print
    return getattr(expr, self.printmethod)(self, *args)
TypeError: unbound method _sympystr() must be called with A instance as first argument (got StrReprPrinter instance instead)


--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-iss...@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