From 3eea6fff8d3c9272aa49cb7a5d75e82ac74706af Mon Sep 17 00:00:00 2001 From: Nikita Nemkin Date: Sun, 14 Apr 2013 15:39:07 +0600 Subject: [PATCH] Changed bint representation in autodoc signatures from 'int' to 'bool'. --- Cython/Compiler/PyrexTypes.py | 8 ++++++++ tests/run/embedsignatures.pyx | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index bb9a38d..07122a7 100755 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -1665,6 +1665,14 @@ class CBIntType(CIntType): from_py_function = "__Pyx_PyObject_IsTrue" exception_check = 1 # for C++ bool + def declaration_code(self, entity_code, + for_display = 0, dll_linkage = None, pyrex = 0): + if pyrex or for_display: + base_code = 'bool' + else: + base_code = public_decl('int', dll_linkage) + return self.base_declaration_code(base_code, entity_code) + def __repr__(self): return "" diff --git a/tests/run/embedsignatures.pyx b/tests/run/embedsignatures.pyx index e931241..8c3b74a 100644 --- a/tests/run/embedsignatures.pyx +++ b/tests/run/embedsignatures.pyx @@ -125,6 +125,9 @@ __doc__ = ur""" >>> print (f_si.__doc__) f_si(signed int i) -> signed int + >>> print (f_bint.__doc__) + f_bint(bool i) -> bool + >>> print (f_l.__doc__) f_l(long l) -> long @@ -318,6 +321,9 @@ cpdef unsigned int f_ui(unsigned int i): cpdef signed int f_si(signed int i): return i +cpdef bint f_bint(bint i): + return i + cpdef long f_l(long l): return l -- 2.7.4