cdef cppclass Square(Rectangle):
int side
- # __init__(int) # need function overloading
+ __init__(int)
int constructor_count, destructor_count
del rect
def test_square_area(w):
- cdef Square *sqr = new Square(w, w)
+ cdef Square *sqr = new Square(w)
cdef Rectangle *rect = sqr
try:
return rect.area(), sqr.area()
{
public:
Square(int side) : Rectangle(side, side) { this->side = side; }
- /* need until function overloading in Cython */
- Square(int side, int ignored) : Rectangle(side, side) { this->side = side; }
int side;
};