basilisp icon indicating copy to clipboard operation
basilisp copied to clipboard

Fetch Var docstrings for `defn` forms from `fn.__doc__`

Open chrisrink10 opened this issue 5 years ago • 0 comments

Right now, functions generated via Basilisp do not have docstrings. Instead, they are generated like:

def f():
    return None

Var.intern(..., meta=lmap.map({"doc": "a docstring"}))

We could potentially improve utility on the Python side if we added the docstrings to the Python functions directly and then just fetched them from the __doc__ function attribute later.

Of course, there is a small risk that the docstring won't exist if the user has specified to start Python in "optimized" mode (-OO flag).

chrisrink10 avatar Mar 28 '19 12:03 chrisrink10