On Jun 2, 2012, at 9:02 AM, Sergiu Ivanov <[email protected]> wrote:
> On Sat, Jun 2, 2012 at 2:11 PM, [email protected] > <[email protected]> wrote: >> >> Both methods work, however for some reason the method used in the >> quantum module is considered a bad design, that should be fixed. I do >> not know why and I personally prefer what is done in the quantum >> module, however I have not really thought about it. > > Hm, I see. Thank you for the information! > > Sergiu Both methods exist because they are both needed. On the one hand, it is essential for objects to be able to define how to print themselves, or else no one would be able to use the printers for their own custom SymPy objects outside of the library. On the other hand, it's a lot easier to maintain the library printing code when it is all together in printing/. That documentation page you linked to carefully documents the specifics of this design. I suppose the quantum module has its printing separate because the physics module is somewhat separate from the rest if SymPy, i.e., it isn't imported with import * and no other modules use code from it. IMHO it doesn't really matter if the physics printing code and tests are in the printing module or in the physics module (though they should probably both be in the same of the two). For category theory, I think it has the potential to be useful outside itself, so I would consider it to not really be separate like physics, and put the code and tests in printing/. But the choice is yours. If the code for it ends up being quite long, you might even consider putting it in its own file (in the category module). Aaron Meurer -- 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.
