2008/9/9 Jason Merrill <[EMAIL PROTECTED]>:
>
>
> def is_constant(f):
>    return SR(f).number_of_arguments() == 0
>
> Since this is so short, in practice there is probably no need to
> define the function is_constant.  If f can't be coerced to the
> symbolic ring, this will throw a TypeError, but that seems like
> perfectly acceptable behavior.  Just catch it.

On the contrary, I do think that this one-liner function is worth
defining, since it turns something a bit obscure which users may well
not work out how to do into something easy.

John

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to