4

I have python-fill-docstring-style set to pep-257 (default) and I'm trying to fill docstring paragraphs. However, python mode does not count """ towards the number of characters, nor does it consider indentation, resulting in:

def function(self):
    """a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
    a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
    a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
    """

and

class A:
    def function(self):
        """a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        """

Note the incorrectly filled first row. How can I fix this?

  • PEP-257 specifies that the first line of a multi-line docstring should be a one-line summary, followed by a blank line, then a full description. So the first line shouldn't be wrapping, anyway. – Ryan Jun 1 '17 at 17:13
  • That is probably a reason nobody cared. Thanks for pointing this out. – Andrzej Pronobis Jun 1 '17 at 17:17
  • Bug#21254 might be related – npostavs Jun 4 '17 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.