[Cython] embedded signatures and function annotations (PEP 3107)

Stefan Behnel stefan_ml at behnel.de
Sun Feb 22 12:56:30 CET 2009


Hi,

I wonder why this function declaration

    cpdef str cf_sd(str s='spam'):
        return s

leads to this embedded signature:

    >>> cf_sd.__doc__
    "cf_sd(str s='spam') -> str"

The return value follows PEP 3107 style annotations, but wouldn't it make
sense to use PEP 3107 style annotations also for the parameter types like this:

    >>> cf_sd.__doc__
    "cf_sd(s : str = 'spam') -> str"

?

Stefan


More information about the Cython-dev mailing list