From: Robert Bradshaw Date: Sun, 15 Aug 2010 07:15:20 +0000 (-0700) Subject: Special method docstring tests. X-Git-Tag: 0.13~20^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=77af99cb69ca6b71ec15dfcb581e3f5cb7529e51;p=cython.git Special method docstring tests. --- diff --git a/tests/run/special_method_docstrings.pyx b/tests/run/special_method_docstrings.pyx new file mode 100644 index 00000000..b556bc9f --- /dev/null +++ b/tests/run/special_method_docstrings.pyx @@ -0,0 +1,39 @@ +cdef class A: + """ + >>> A.__init__.__doc__ + 'A.__init__ docstring' + >>> A.__len__.__doc__ + 'A.__len__ docstring' + >>> A.__add__.__doc__ + 'A.__add__ docstring' + """ + def __init__(self): + "A.__init__ docstring" + def __len__(self): + "A.__len__ docstring" + def __add__(self, other): + "A.__add__ docstring" + +cdef class B(A): + """ + >>> B.__init__.__doc__ + 'A.__init__ docstring' + >>> B.__len__.__doc__ + 'B.__len__ docstring' + >>> B.__add__.__doc__ + 'A.__add__ docstring' + """ + def __len__(self): + "B.__len__ docstring" + +class C(A): + """ + >>> C.__init__.__doc__ + 'A.__init__ docstring' + >>> C.__len__.__doc__ + 'C.__len__ docstring' + >>> C.__add__.__doc__ + 'A.__add__ docstring' + """ + def __len__(self): + "C.__len__ docstring"