Python Mixins

Tim Chase python.list at tim.thechases.com
Sun Sep 25 01:36:56 CEST 2011


On 09/24/11 17:41, rantingrick wrote:
> On Sep 24, 3:57 am, Steven D'Aprano<steve
> +comp.lang.pyt... at pearwood.info>  wrote:
>
>> class StandardTestMixin:
>>      def test_requires_one_argument(self):
>>          self.assertRaises(TypeError, self.func)
>>      def test_has_docstring(self):
>>          self.assertTrue(self.func.__doc__)
>
> And this is another example of why we need doc-string reforms. Here we
> have a well know "pythonista" (for lack of better word) who needs to
> write a test for doc-string inclusion because he refuses to get in the
> habit of writing them. People, EVERY method and function MUST have a
> doc-string! What is the purpose of having doc-strings if we are too
> lazy to use them!

http://www.python.org/dev/peps/pep-0257/

"""
The aim of this PEP is to standardize the high-level structure of 
docstrings: what they should contain, and how to say it (without 
touching on any markup syntax within docstrings). The PEP 
contains conventions, not laws or syntax.
"""

You keep saying the word "MUST".  I do not think it means what 
you think it means.  Just for the record [1], [2], [3], [4] all 
in my first page of search Google search results.  Pot, meet 
kettle.

-tkc

[1]
http://mail.python.org/pipermail/python-list/2009-September/1220068.html

[2]
http://mail.python.org/pipermail//python-list/2011-July/1276021.html

[3]
http://mail.python.org/pipermail/python-list/2010-March/1237898.html

[4]
http://mail.python.org/pipermail/python-list/2010-June/1246305.html



More information about the Python-list mailing list