I have a module in which a define a module __doc__
string (multiline) which I also want to use in my argparse usage.
So at first I defined it as
'''My
multiline
module
doc-string
'''
and used it in the following way
parser = argparse.ArgumentParser(description=str(__doc__),
formatter_class=SmartFormatter)
(Note: left out the SmartFormatter
class since it is not part of the problem).
When I now give the -h
option it prints None
where the doc-string should be.
I can solve it easily by defining the doc-string as follows:
__doc__ = '''My
multiline
module
doc-string
'''
But then pylint starts complaining:
<file.py>:<line>: [W0622(redefined-builtin), ] Redefining built-in '__doc__'
So now is my question how I can access the module doc-string without redefining __doc__
, preferably I don't want to ignore the W0622 warning.