Aug-25-2022, 08:58 AM
(This post was last modified: Aug-25-2022, 08:58 AM by Gribouillis.)
One can also use the backslash as a line continuation character
>>> def func(): ... "The first part of the docstring,"\ ... " now the rest of it,"\ ... " and some more." ... pass ... >>> func() >>> func.__doc__ 'The first part of the docstring, now the rest of it, and some more.'An even wilder option
>>> def func(): ... "spam \ ... ham \ ... eggs" ... print('Hi') ... >>> func() Hi >>> func.__doc__ 'spam ham eggs' >>>