I agree with Matthew here. Adding the argument makes things very unambiguous and it is completely backwards compatible.
Jason moorepants.info +01 530-601-9791 On Wed, Sep 4, 2013 at 3:16 AM, Matthew Brett <matthew.br...@gmail.com>wrote: > Hi, > > On Tue, Sep 3, 2013 at 8:08 PM, Gilbert Gede <gilbertg...@gmail.com> > wrote: > > I think there were concerns on adding additional arguments to lambdify. > That > > was why I added the dummify flag to the lower-level lambdastr instead, > and > > tried to keep lambdify's interface simple. > > > > I think the logic could be re-written to be a little more robust - maybe > not > > dummifying if a dictionary or 'sympy' is explicitly passed in or > implemented > > functions are provided, and only dummifying if the numeric outputs are > going > > to take precedence over the symbolic outputs? > > Would you mind giving an example where it would be a very bad idea to > dummify? I read the pull request discussion, but I think the really > nasty examples Stefan gave actually raise errors with dummify. I ask > only because I didn't entirely understand the problem. > > For guessing, my guess would be that someone wanted numerical > evaluation if there is: > > * a dictionary first argument > * any other namespace than sympy as first argument > * an implemented function anywhere > > But I think this is a typical example of zen of Python : > > $ python -c 'import this' | grep guess > In the face of ambiguity, refuse the temptation to guess. > > > I suppose the question is: Are there use cases where dummification is > > needed, and there are implemented functions or the desired module is > > 'sympy'? If so, we should add dummification as a flag. > > Let's say the user does want: > > y = x(t) > lambdify(y, 2 * y) > > to work. Then, at the moment, they have to guess how we are guessing > that they will tell us that. > > Whereas: > > lambdify(y, 2 * y, dummify=True) > > with a good docstring, seems like it's not much extra work or extra > complexity in the signature, for the reasonably large gain in clarity. > > Cheers, > > Matthew > > -- > 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. > For more options, visit https://groups.google.com/groups/opt_out. > -- 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. For more options, visit https://groups.google.com/groups/opt_out.