OK, this is a minor quibble from someone who is not *normally* concerned with neatness.
I want to put docstrings in my functions. If I put them in using the 'textbook' method:
def is_same(self,x):
"""A.is_same(x) --> Bool\n\nReturns True if A and x represent
essentially the same item, as determined by their userid. Useful
for detecting undesired conflicts on lists that require unique
items."""
the code looks nice, but help(A.is_same) comes out as
>>>help(Account.is_same)
is_same(self, x) unbound __main__.Account method
A.is_same(x) --> Bool
Returns True if A and x represent essentially
the same item, as determined by their userid. Useful for
detecting undesired conflicts on lists that require unique
items.
which isn't terrible, but doesn't justify the paragraph correctly.
OTOH, I can write
def to_edit(self, new=False):
"A.to_edit([new])--> (label,default)\n\nProduces a tuple for use \
by an Edit_Dialog. The labels will be \ndisplayed by the Edit_Dialog, \
and the default will be used to fill in \nthe fields. If new == True, \
None will be passed to Edit_Dialog."
which gives
>>>help(Account.is_same)
to_edit(self, new=False) unbound __main__.Account method
A.to_edit([new])--> (label,default)
Produces a tuple for use by an Edit_Dialog. The labels will be
displayed by the Edit_Dialog, and the default will be used to fill in
the fields. If new == True, None will be passed to Edit_Dialog.
So far, it seems that I'm forced to choose between readable docstrings and readable code. Anyone have a different solution?
Thanks,
Jeff