# HG changeset patch
# User Nicolas M. Thiery <nthiery@users.sf.net>
# Date 1331914899 -3600
# Node ID 5c123c59de8c2788fbfb29ac46c95e10182272fb
# Parent e3c19550b5b9fa3d830fbea6bab34db685a5827c
#12677: Make the doctests of sage.misc.sageinspect.sage_getargspec independent of ``Poset``
diff --git a/sage/misc/sageinspect.py b/sage/misc/sageinspect.py
a
|
b
|
def sage_getargspec(obj): |
947 | 947 | EXAMPLES:: |
948 | 948 | |
949 | 949 | sage: from sage.misc.sageinspect import sage_getargspec |
| 950 | sage: def f(x, y, z=1, t=2, *args, **keywords): |
| 951 | ... pass |
| 952 | sage: sage_getargspec(f) |
| 953 | ArgSpec(args=['x', 'y', 'z', 't'], varargs='args', keywords='keywords', defaults=(1, 2)) |
| 954 | |
| 955 | We now run sage_getargspec on some functions from the Sage library:: |
| 956 | |
950 | 957 | sage: sage_getargspec(identity_matrix) |
951 | 958 | ArgSpec(args=['ring', 'n', 'sparse'], varargs=None, keywords=None, defaults=(0, False)) |
952 | | sage: sage_getargspec(Poset) |
953 | | ArgSpec(args=['data', 'element_labels', 'cover_relations', 'category', 'facade', 'key'], varargs=None, keywords=None, defaults=(None, None, False, None, None, None)) |
954 | 959 | sage: sage_getargspec(factor) |
955 | 960 | ArgSpec(args=['n', 'proof', 'int_', 'algorithm', 'verbose'], varargs=None, keywords='kwds', defaults=(None, False, 'pari', 0)) |
956 | 961 | |
| 962 | |
957 | 963 | In the case of a class or a class instance, the ``ArgSpec`` of the ``__new__`` or ``__init__`` |
958 | 964 | methods are returned:: |
959 | 965 | |