def doc(self):
        '''Algorithm from https://www.python.org/dev/peps/pep-0257/'''
        if not self.__doc__:
            return ""

        lines = self.__doc__.expandtabs().splitlines()

        # Determine minimum indentation (first line doesn't count):
        indent = sys.maxsize
        for line in lines[1:]:
            stripped = line.lstrip()
            if stripped:
                indent = min(indent, len(line) - len(stripped))

        # Remove indentation (first line is special):
        trimmed = [lines[0].strip()]
        if indent < sys.maxsize:
            for line in lines[1:]:
                trimmed.append(line[indent:].rstrip())

        # Strip off trailing and leading blank lines:
        while trimmed and not trimmed[-1]:
            trimmed.pop()
        while trimmed and not trimmed[0]:
            trimmed.pop(0)

        # Return a single string:
        return '\n'.join(trimmed)
def doc(self):
        '''Algorithm from https://www.python.org/dev/peps/pep-0257/'''
        if not self.__doc__:
            return ""

        lines = self.__doc__.expandtabs().splitlines()

        # Determine minimum indentation (first line doesn't count):
        indent = sys.maxsize
        for line in lines[1:]:
            stripped = line.lstrip()
            if stripped:
                indent = min(indent, len(line) - len(stripped))

        # Remove indentation (first line is special):
        trimmed = [lines[0].strip()]
        if indent < sys.maxsize:
            for line in lines[1:]:
                trimmed.append(line[indent:].rstrip())

        # Strip off trailing and leading blank lines:
        while trimmed and not trimmed[-1]:
            trimmed.pop()
        while trimmed and not trimmed[0]:
            trimmed.pop(0)

        # Return a single string:
        return '\n'.join(trimmed)
def doc ( self ) : if not self . __doc__ : return "" lines = self . __doc__ . expandtabs ( ) . splitlines ( ) # Determine minimum indentation (first line doesn't count): indent = sys . maxsize for line in lines [ 1 : ] : stripped = line . lstrip ( ) if stripped : indent = min ( indent , len ( line ) - len ( stripped ) ) # Remove indentation (first line is special): trimmed = [ lines [ 0 ] . strip ( ) ] if indent < sys . maxsize : for line in lines [ 1 : ] : trimmed . append ( line [ indent : ] . rstrip ( ) ) # Strip off trailing and leading blank lines: while trimmed and not trimmed [ - 1 ] : trimmed . pop ( ) while trimmed and not trimmed [ 0 ] : trimmed . pop ( 0 ) # Return a single string: return '\n' . join ( trimmed )
Algorithm from https://www.python.org/dev/peps/pep-0257/
Algorithm from https : // www . python . org / dev / peps / pep - 0257 /