Its a docstring - it documents the function/class<div>Did you know that docstrings can be used for testing - look at the doctest standard library module!<br><div>try:</div><div><br></div><div>class A:</div><div>    def method(self):</div>
<div>        '''Sample method</div><div>This method does the difficult task X.</div><div>Call this method with no arguments.'''#docstring</div><div>        pass</div><div><br></div><div>then type :</div>
<div><br></div><div>help(A.method)</div><div><br></div><div>And viola!<br><div class="gmail_quote">On 6 August 2012 20:26, Jean Dubois <span dir="ltr"><<a href="mailto:jeandubois314@gmail.com" target="_blank">jeandubois314@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 5 aug, 20:28, Mark Lawrence <<a href="mailto:breamore...@yahoo.co.uk">breamore...@yahoo.co.uk</a>> wrote:<br>

> On 05/08/2012 19:04, Jean Dubois wrote:<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
</div><div><div class="h5">> > On 5 aug, 02:11, <a href="mailto:shearich...@gmail.com">shearich...@gmail.com</a> wrote:<br>
> >> One reason you may be having difficulty is that unlike some languages (C++/Java) object-orientation is not a be all and end all in Python, in fact you could work with Python for a long time without really 'doing it' at all (well other than calling methods/properties on existing API's). Having said that here's what I would suggest ...<br>

><br>
> >> Could do worse than this :<br>
><br>
> >><a href="http://www.diveintopython.net/object_oriented_framework/index.html" target="_blank">http://www.diveintopython.net/object_oriented_framework/index.html</a><br>
><br>
> > This example seems to tell you need the concept of dictionaries to<br>
> > explain object oriented programming, is this really necessary?<br>
> >> and this<br>
><br>
> >><a href="http://docs.python.org/tutorial/classes.html" target="_blank">http://docs.python.org/tutorial/classes.html</a><br>
> > Unfortunately, the trouble with this explanation is exactly what made<br>
> > me ask the original question: it starts from concepts in c++ making it<br>
> > very hard to understand for someone who does not know that language<br>
> > already.<br>
><br>
> >> read together.<br>
><br>
> >> Judging by your question this is a probably a little advanced for now but you could bookmark it for the future:<br>
><br>
> >><a href="http://www.catonmat.net/blog/learning-python-design-patterns-through-." target="_blank">http://www.catonmat.net/blog/learning-python-design-patterns-through-.</a>..<br>
><br>
> >> Here's the corresponding PDF to go with the video:<br>
><br>
> >><a href="http://assets.en.oreilly.com/1/event/45/Practical%20Python%20Patterns." target="_blank">http://assets.en.oreilly.com/1/event/45/Practical%20Python%20Patterns.</a>..<br>
> > Can someone here on this list give a trivial example of what object<br>
> > oriented programming is, using only Python?<br>
><br>
> > thanks in advance<br>
> > Jean<br>
><br>
</div></div>> Try thishttp://<a href="http://www.voidspace.org.uk/python/articles/OOP.shtml?" target="_blank">www.voidspace.org.uk/python/articles/OOP.shtml?</a>??<br>
><br>
> --<br>
> Cheers.<br>
><br>
> Mark Lawrence.<br>
Thanks, this one is a lot better. Could you just tell me what the use<br>
is of the following lines:<br>
"""Class docstring."""<br>
"""Method docstring."""<br>
"""Method docstring."""<br>
Taken from the following code fragment (I really want to understand<br>
every bit of code, and the author doesn't mention this)<br>
<br>
<br>
class OurClass(object):<br>
    """Class docstring."""<br>
<br>
    def __init__(self, arg1, arg2):<br>
        """Method docstring."""<br>
        self.arg1 = arg1<br>
        self.arg2 = arg2<br>
<br>
    def printargs(self):<br>
        """Method docstring."""<br>
        print self.arg1<br>
        print self.arg2<br>
<br>
<br>
<br>
thanks in advance<br>
<span class="HOEnZb"><font color="#888888">jean<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br></div></div>