[issue17159] Remove explicit type check from inspect.Signature.from_function()

Stefan Behnel report at bugs.python.org
Thu Jan 30 18:15:30 CET 2014


Stefan Behnel added the comment:

LGTM, thanks!

And works nicely with Cython:

"""
import inspect

def test_isfunction():
    """
    >>> test_isfunction()
    True
    """
    return inspect.isfunction(test_isfunction)

def test_signature():
    """
    >>> test_signature()   # doctest: +ELLIPSIS
    <inspect.Signature object ...>
    """
    return inspect.signature(test_signature)
"""

> BTW, do cython functions have __name__ attribute?

Yes, they have everything that can possibly be emulated (although not
everything currently contains useful information). If your question is
whether that should be tested for, too, then I'd say yes.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17159>
_______________________________________


More information about the Python-bugs-list mailing list