Dr. Dobb's Python-URL! - weekly Python news and links (Mar 26)

phil hunt philh at comuno.freeserve.co.uk
Thu Mar 28 20:55:17 EST 2002


On Thu, 28 Mar 2002 15:42:10 -0800, Cliff Wells <logiplexsoftware at earthlink.net> wrote:
>On Thu, 28 Mar 2002 15:43:20 -0800
>David Ascher wrote:
>> May I suggest that you instead do:
>> 
>> >>> class MyClass:
>> ...     def do_this(self):
>> ...             "this function would do this"
>> ...     def do_that(self):
>> ...             "while this function would do that"
>> ...
>> >>>
>> 
>> and use the docstrings as a placeholder for the actions of the function
>> -- typically something that's foremost in your mind when you're
>> pseudocoding, and it counts as a statement as far as the parser's
>> concerned (hence is syntactically valid), and at the same time, you've
>> already got docstrings ready for  you when you start to implement.
>
>Phil is trying to avoid having to backspace 4 times to delete a pass
>statement.  Why the hell would he want to type in an entire docstring???

Why would I want to write documentation anyway? :-)

-- 
<"><"><"> Philip Hunt <philh at comuno.freeserve.co.uk> <"><"><">
"I would guess that he really believes whatever is politically 
advantageous for him to believe." 
                        -- Alison Brooks, referring to Michael
                              Portillo, on soc.history.what-if



More information about the Python-list mailing list