class ClassExample():
    '''This first line is a summary of this class. \
There must be ONLY one logical line in this overview.
    
    However (notice that must be an empty line between the summary and this
    block of text), the rest of this doctrings can be placed in several lines.
    These lines usually provides extended information about the functionality
    of the class. The last line of the docstring should contain only
    three simple quotation marks (as follows).
    '''
    
    x = 1
    
    def __init__(self):
        '''A summary about the constructor. This is an example of a one-line docstring.'''
        print(self.x)
        
    def set(self, x):
        '''A summary about \"set\".
        
        Arguments:
            x: an integer that ... bla, bla, bla.
            (Notice the indentation of this/these lines)
            
        Returns:
            Nothing.
        '''
        self.x = x
        
    def get(self):
        '''A summary about \"get\".
        
        Arguments:
            None.
            
        Returns:
            The value of \"x\".
        '''
        return self.x

"""
Explanation: The Docstring system
A docstring is a string literal that occurs as the first statement in a package, module or function (method). These structures (Python objects) can be properly commented and the documentation processed/retrieved by tools such as <!-- Docutils,--> Sphinx and help().
1. Example: commenting a class
End of explanation
"""


help(ClassExample)

"""
Explanation: 2. Using help()
Getting help for a whole class.
End of explanation
"""


ClassExample?

"""
Explanation: A different way of getting help (in Ipython):
End of explanation
"""


help(ClassExample.get)

"""
Explanation: Getting help for a single member function:
End of explanation
"""


print(ClassExample.get.__doc__)

print(type(ClassExample.get.__doc__))

"""
Explanation: help() only prints the __doc__ variable:
Any function, class or module starting with a string literal has a non-empty __doc__ attribute which can be printed to get information.
End of explanation
"""


a = ClassExample()

help(a)

help(a.set)

print(a.__doc__)

print(a.get.__doc__)

"""
Explanation: The same queries can be carried out with an instance.
End of explanation
"""


