Skip to content

sage_getargspec on Cython class instances prefers __init__ over __call__ #20860

@jdemeyer

Description

@jdemeyer

The following Cython code

cimport cython
@cython.embedsignature(True)
cdef class MyClass(object):
    def __init__(self, x):
        pass
        
    def __call__(self, y):
        pass
        
from sage.misc.sageinspect import sage_getargspec
print(sage_getargspec(MyClass("hello")))

gives the argspec of __init__ instead of __call__:

ArgSpec(args=['x'], varargs=None, keywords=None, defaults=None)

CC: @simon-king-jena @nthiery

Component: documentation

Issue created by migration from https://trac.sagemath.org/ticket/20860

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions