On Wed, Jun 10, 2009 at 1:10 PM, Brian Granger<ellisonbg....@gmail.com> wrote: > >>> It look like your patches will make it much easier for users to create >>> custom Sympy types that are on equal grounds as the built in ones. Is >>> this the case? If I create a new type, will I be able to implement >>> queries for that type and will I be able to tell the Sympy core about >>> my objects without modifying the Sympy core? >> >> Yes, definitely! > > Great! > >>> I think we should make it a goal that new sympy types can be created >>> without modifying Sympy core. Another area that currently violates >>> this idea is the printing system. But, this will have to be modified >>> anyways to get it to work with the Sage notebook's handling of latex >>> output. >> >> It has to be fixed for the sage notebook, but otherwise how does it violate >> it? > > Currently, I don't think it does . But, the naive fix for the sage > notebook issue introduces an infinite recursion (_latex_ calls > Printer._print, calls _latex). We just have to make we resolve this > in a way that doesn't break user's ability to create both new Printers > and new Sympy types. I know this because I have a hack in my local > branch that fixes the sage notebook issue but breaks the overall > printing model.
If there is an infinite recursion, then it's a bug, it should work nice. I think the problem is that _latex_ is not designed to be called directly. You should call Basic.__str__(), or just Printer.doprint(). So if the notebook is calling _latex_, then it's just a coincidence, and we should either rename the sympy method, or fix the Sage notebook. Ondrej --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy-patches" group. To post to this group, send email to sympy-patches@googlegroups.com To unsubscribe from this group, send email to sympy-patches+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sympy-patches?hl=en -~----------~----~----~----~------~----~------~--~---