Changed bint representation in autodoc signatures from 'int' to 'bool'.
authorNikita Nemkin <nikita@nemkin.ru>
Sun, 14 Apr 2013 09:39:07 +0000 (15:39 +0600)
committerNikita Nemkin <nikita@nemkin.ru>
Sun, 14 Apr 2013 09:39:07 +0000 (15:39 +0600)
Cython/Compiler/PyrexTypes.py
tests/run/embedsignatures.pyx

index bb9a38d..07122a7 100755 (executable)
@@ -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 "<CNumericType bint>"
 
index e931241..8c3b74a 100644 (file)
@@ -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