<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 19, 2015 at 2:14 PM, Philipp A. <span dir="ltr"><<a href="mailto:flying-sheep@web.de" target="_blank">flying-sheep@web.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">I have am idea: how about including a @paramdoc decorator that accepts one named string argument per parameter and appends information gathered via type annotations and default values to the docstring?</p>
<p dir="ltr">E.g.</p>
<p dir="ltr">~~~~<br>
@paramdoc(<br>
    main_course="Meaty because our society is medieval",<br>
    side_dish="Optional, meat is enough",<br>
    __return__="Objective opinion")<br>
def eat(main_course: Meat, side_dish=None: Food) -> Opinion:<br>
    """<br>
    Decides how well the meat and side dish taste together<br>
    """<br>
    ...<br>
</p></blockquote><div>aside from my thoughts about this being an odd use of the decorator syntax, I fail to see how this is better than simply putting the information in the docstring itself? You still are putting information in two places, making it easy for it to get out of sync, and I think it actually make sit harder to read -- that could end up being one really big decorator.</div><div><br></div><div>-Chris</div><div><br></div><div><br></div></div><div><br></div>-- <br><div class="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>