summaryrefslogtreecommitdiff
path: root/tests/run/staticmethod.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/staticmethod.pyx')
-rw-r--r--tests/run/staticmethod.pyx42
1 files changed, 12 insertions, 30 deletions
diff --git a/tests/run/staticmethod.pyx b/tests/run/staticmethod.pyx
index ceaf616fb..5ede6a642 100644
--- a/tests/run/staticmethod.pyx
+++ b/tests/run/staticmethod.pyx
@@ -1,35 +1,17 @@
-__doc__ = u"""
->>> class1.plus1(1)
-2
->>> class2.plus1(1)
-2
->>> class3.plus1(1)
-2
->>> class4.plus1(1)
-2
->>> class4().plus1(1)
-2
->>> class4.bplus1(1)
-2
->>> class4().bplus1(1)
-2
-"""
-
cimport cython
-def f_plus(a):
- return a + 1
class class1:
- plus1 = f_plus
-
-class class2(object):
- plus1 = f_plus
-
-cdef class class3:
- plus1 = f_plus
-
-class class4:
+ u"""
+ >>> class1.plus1(1)
+ 2
+ >>> class1().plus1(1)
+ 2
+ >>> class1.bplus1(1)
+ 2
+ >>> class1().bplus1(1)
+ 2
+ """
@staticmethod
def plus1(a):
return a + 1
@@ -49,14 +31,14 @@ def nested_class():
>>> obj.plus1(1)
2
"""
- class class5(object):
+ class class2(object):
def __new__(cls): # implicit staticmethod
return object.__new__(cls)
@staticmethod
def plus1(a):
return a + 1
- return class5
+ return class2
cdef class BaseClass(object):