From 1640ce78d85f7928778f3cd06201a922748dc779 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 5 Dec 2009 14:26:15 +0100 Subject: [PATCH] test case for ticket #462 --- tests/bugs.txt | 1 + tests/run/cdef_methods_T462.pyx | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/run/cdef_methods_T462.pyx 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:] -- 2.26.2