Commit 2986d78b authored by Stefan Behnel's avatar Stefan Behnel

let docstring test check string type (str/unicode)

parent 495011ef
No related merge requests found
__doc__ = """ __doc__ = """
>>> print f.__doc__ >>> f.__doc__
This is a function docstring. 'This is a function docstring.'
>>> print C.__doc__ >>> C.__doc__
This is a class docstring. 'This is a class docstring.'
>>> print CS.__doc__ >>> CS.__doc__
This is a subclass docstring. 'This is a subclass docstring.'
>>> print CSS.__doc__ >>> print CSS.__doc__
None None
>>> print T.__doc__ >>> T.__doc__
This is an extension type docstring. 'This is an extension type docstring.'
>>> print TS.__doc__ >>> TS.__doc__
This is an extension subtype docstring. 'This is an extension subtype docstring.'
>>> print TSS.__doc__ >>> TSS.__doc__
None
Compare with standard Python: Compare with standard Python:
>>> def f(): >>> def f():
... "This is a function docstring." ... 'This is a function docstring.'
>>> print f.__doc__ >>> f.__doc__
This is a function docstring. 'This is a function docstring.'
>>> class C: >>> class C:
... "This is a class docstring." ... 'This is a class docstring.'
>>> class CS(C): >>> class CS(C):
... "This is a subclass docstring." ... 'This is a subclass docstring.'
>>> class CSS(CS): >>> class CSS(CS):
... pass ... pass
>>> print C.__doc__ >>> C.__doc__
This is a class docstring. 'This is a class docstring.'
>>> print CS.__doc__ >>> CS.__doc__
This is a subclass docstring. 'This is a subclass docstring.'
>>> print CSS.__doc__ >>> CSS.__doc__
None
""" """
def f(): def f():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment