On Tue, Jul 20, 2010 at 4:17 PM, Marco Streng <marco.str...@gmail.com> wrote:
> I have a question that I thought was a simple python question, but I was
> unable to find the answer on the internet.
>
> Suppose I want to find out if "root" is a valid keyword argument for the
> "is_square" function of an object "a". Is there a good way to do this?

This works for Python functions, but since it Integer.is_square is a
defined in a Cython extension module, it doesn't have the properties
needed for getargspec to work.  However, you can use the following
which should work (at least somewhat) with extension modules:

sage: sage.misc.sageinspect.sage_getargspec(Integer.is_square)
(['self'], None, None, None)
sage: sage.misc.sageinspect.sage_getargspec(Integer.factor)
(['self', 'algorithm', 'proof', 'limit'], None, None, ('pari', True, None))

--Mike

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to