Ticket #8244: trac_8244-slot_wrapper_argspec.patch

File trac_8244-slot_wrapper_argspec.patch, 957 bytes (added by mpatel, 11 years ago)

Handle *.next methods. sage repo.

  • sage/misc/sageinspect.py

    # HG changeset patch
    # User Mitesh Patel <qed777@gmail.com>
    # Date 1266549879 28800
    # Node ID 4f9c5751c942f55d3ba50e43ee901f099d7a5723
    # Parent  1e07efef3326ca38e04699793ad7f4741d8179d8
    #8244: Arg spec for .next() slot wrappers
    
    diff --git a/sage/misc/sageinspect.py b/sage/misc/sageinspect.py
    a b def sage_getargspec(obj): 
    434434        return sage_getargspec(obj.__class__.__call__)
    435435    elif inspect.isclass(obj):
    436436        return sage_getargspec(obj.__call__)
     437    elif (hasattr(obj, '__objclass__') and hasattr(obj, '__name__') and
     438          obj.__name__ == 'next'):
     439        # Handle sage.rings.ring.FiniteFieldIterator.next and similar
     440        # slot wrappers.  This is mainly to suppress Sphinx warnings.
     441        return ['self'], None, None, None
    437442    else:
    438443        # Perhaps it is binary and defined in a Cython file
    439444        source = sage_getsource(obj, is_binary=True)