From: Robert Bradshaw Date: Thu, 9 Jul 2009 07:46:03 +0000 (-0700) Subject: Fix cpp class example (now that we have function overloading). X-Git-Tag: 0.13.beta0~353^2~63 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=1c7b7b3d78a9617e66df385cbd365eab3a7d6c70;p=cython.git Fix cpp class example (now that we have function overloading). --- 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; };