Status: Accepted
Owner: Toon.Verstraelen
Labels: Type-Defect Priority-Medium Printing

New issue 1533 by Toon.Verstraelen: printmethod must have printer object as  
first argument
http://code.google.com/p/sympy/issues/detail?id=1533

This allows simple callback to the _print method from within a user defined
print method. Example: this is how it works now:

def test_printmethod():
     class fabs(abs):
         def _ccode_(self):
             return "fabs(%s)" % ccode(self.args[0])
     assert ccode(fabs(x)) == "fabs(x)"

The following is faster and also guarantees that the printer settings are
used for printing the arguments:

def test_printmethod():
     class fabs(abs):
         def _ccode_(self, printer):
             return "fabs(%s)" % printer._print(self.args[0])
     assert ccode(fabs(x)) == "fabs(x)"

Will upload patch soon.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

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

Reply via email to