On Thursday, July 3, 2014 11:43:13 PM UTC+2, Aaron Meurer wrote: > > I'm just now catching up on the other thread. I'll post more comments > there. > > To answer your question, "A subclass shall match its parent, but in > case its parent's constructor accepts different parameters, strange > things may happen." If this happens, then the subclass is doing the > wrong thing, because this violates the Liskov principle. So we should > always assume that subclasses are correct in this sense. > > Consider this case: the expression contains *Basic(a, b, c, d, ...)* while the pattern contains *Symbol("x")*. Symbol is a subtype of Basic, but Symbol can only have one argument in its constructor, while Basic may have any arbitrary number of arguments. I suppose that in such a case the correct behavior would be to yield no matches, but one has to be careful that the code does not try to pass many arguments to Symbol( ... ), otherwise an exception is probably going to be raised.
-- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/c1e5ddc0-65dd-4747-9c03-2db16fb49775%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.