Aug-24-2022, 05:18 PM
I've been experimenting and you can use parentheses and implicit string concatenation
>>> def func(): ... ("This is the beginning of a very long docstring which must stand on one line" ... " now the rest of this very long docstring hope it will be allright.") ... print('Hello from func()') ... >>> func() Hello from func() >>> func.__doc__ 'This is the beginning of a very long docstring which must stand on one line now the rest of this very long docstring hope it will be allright.'The uncommon part is that usually docstrings have a reasonably sized first line and may have other lines.