Ticket #354 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

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

Changed 3 years ago by robertwb

This also fails for public properties.

Changed 3 years ago by scoder

  • owner changed from somebody to dalcinl
  • milestone changed from wishlist to 0.13

Fixed by Lisandros property code rewrite.

Changed 3 years ago by scoder

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.