Am 23. November 2017 15:32:13 MEZ schrieb Jeroen Demeyer: >Many Python/C API functions create objects of a known type. For >example, >PyUnicode_Decode() always returns a "unicode" object. In some cases, >this return type is reflected in the declaration in >Cython/Includes/cpython, in other cases (such as PyUnicodeDecode() that > >I just mentioned) not. > >What is Cython's policy here? In particular, what should be done when >adding new declarations?
It's not about policy. There probably wasn't any advantage yet back when they were added, certainly no type inference, and in some cases, there still isn't much to gain from them. But it's certainly a good idea to provide as much type information as possible here, so feel free to add it wherever it may fit. Stefan _______________________________________________ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel