to., 23.09.2010 kl. 18.54 -0700, skrev Ondrej Certik: > On Thu, Sep 23, 2010 at 6:42 PM, Andy Ray Terrel <andy.ter...@gmail.com> > wrote: > > The problem with the is_Foo construct is that every basic has to carry > > it, so every object grows. The reason (maybe historic) there are some > > there is that its faster to ask is_Foo than to do isinstance a lot and > > the core needs some faster things. For bits that aren't checked very > > much we should try to keep it out of the core (maybe put it in the > > assumptions). > > > > Of course once Indexed elements start propogating to other modules it > > might be necessary to do this. For now I vote that we either include a > > depth first search for the properties. > > Yeah, I am not convinced that this is_Foo is the best way to go. I > believe that we can use it for *core* only, but external code should > not use it. Eventually we'll use Cython for the core anyway > (optionally), and there might be some other (fast) way to do the same. >
I agree to this. In my codes I just use isinstance for this, as the speed penalty in most cases is negligible. However, when the Indexed stuff matures, and if it start propagating to other modules, we may consider if parts of it should be moved into the core. At that point, if it ever happens, the .is_Indexed attribute seems natural. Øyvind > Ondrej > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.