From: Stefan Behnel Date: Sat, 5 Dec 2009 13:26:15 +0000 (+0100) Subject: test case for ticket #462 X-Git-Tag: 0.12.1~85 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=1640ce78d85f7928778f3cd06201a922748dc779;p=cython.git test case for ticket #462 --- diff --git a/tests/bugs.txt b/tests/bugs.txt index 55e7e2c3..b41b895a 100644 --- a/tests/bugs.txt +++ b/tests/bugs.txt @@ -7,3 +7,4 @@ numpy_ValueError_T172 unsignedbehaviour_T184 missing_baseclass_in_predecl_T262 cfunc_call_tuple_args_T408 +cdef_methods_T462 diff --git a/tests/run/cdef_methods_T462.pyx b/tests/run/cdef_methods_T462.pyx new file mode 100644 index 00000000..7a5bc340 --- /dev/null +++ b/tests/run/cdef_methods_T462.pyx @@ -0,0 +1,31 @@ + +cimport cython + +cdef class cclass: + def test_self(self): + """ + >>> cclass().test_self() + 'cclass' + """ + return cython.typeof(self) + + def test_self_1(self, arg): + """ + >>> cclass().test_self_1(1) + ('cclass', (1,)) + """ + return cython.typeof(self), arg + + def test_self_args(self, *args): + """ + >>> cclass().normal_test1_args(1,2,3) + ('cclass', (1, 2, 3)) + """ + return cython.typeof(self), args + + def test_args(*args): + """ + >>> cclass().normal_test0_args(1,2,3): + ("Python object", (1, 2, 3)) + """ + return cython.typeof(args[0]), args[1:]