From 1c7b7b3d78a9617e66df385cbd365eab3a7d6c70 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 9 Jul 2009 00:46:03 -0700 Subject: [PATCH] Fix cpp class example (now that we have function overloading). --- tests/run/cpp_classes.pyx | 4 ++-- tests/run/shapes.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/run/cpp_classes.pyx b/tests/run/cpp_classes.pyx index 056ae81e..84cbfaa0 100644 --- a/tests/run/cpp_classes.pyx +++ b/tests/run/cpp_classes.pyx @@ -23,7 +23,7 @@ cdef extern from "shapes.h" namespace shapes: cdef cppclass Square(Rectangle): int side - # __init__(int) # need function overloading + __init__(int) int constructor_count, destructor_count @@ -41,7 +41,7 @@ def test_rect_area(w, h): 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() diff --git a/tests/run/shapes.h b/tests/run/shapes.h index 3106d01c..033a30b8 100644 --- a/tests/run/shapes.h +++ b/tests/run/shapes.h @@ -31,8 +31,6 @@ namespace shapes { { 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; }; -- 2.26.2