Ticket #354 (closed defect: fixed)
bint type isn't handled in readonly property access
| Reported by: | scoder | Owned by: | dalcinl |
|---|---|---|---|
| Priority: | major | Milestone: | 0.13 |
| Component: | Code Generation | Keywords: | |
| Cc: |
Description
Declaring a readonly property as type bint doesn't yield the expected result.
cdef class Test:
"""
>>> t = Test(True)
>>> t.some_bool # this will fail and return 1 instead !!
True
"""
cdef readonly bint some_bool
def __init__(self, bint boolval):
self.some_bool = boolval
The generated code declares some_bool as type int and returns an integer value on access. Note that the above doctest will pass in Python 2.x where the doctest module accepts "True" for value "1". It fails in Py3.1, though.
Change History
Note: See
TracTickets for help on using
tickets.
