Hello, I am trying to create custom pretty-printing behaviour for my class Morphism. What would be the canonical example for that? I've found [0], which says that I could do that by defining a method _print_Morphism in one of the pretty printers. However, I have also seen what I believe is connected to pretty printing in sympy.physics.quantum.gate.Gate for instance, the methods _sympystr(), _pretty(), _latex(). Is defining such methods the proper way to go today? Also, what would be the difference between defining _sympystr() and str()? I can see that Gate does not define str() at all.
And yet another question refers to testing. I can see that there are a lot of tests referring to built-in SymPy primitives in sympy/printing/pretty/tests/test_pretty.py; also, there are a couple pretty-printing related tests in other modules. However, I cannot see pretty printing being tested in sympy.physics.quantum. So, is it going to be okay if I test the pretty printing of Morphism in the tests of category theory module, or should I put the tests in a different place? Sergiu [0] http://docs.sympy.org/dev/modules/printing.html -- You received this message because you are subscribed to the Google Groups "sympy" 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?hl=en.
