re: getting a description for `@union`: feel free ...
# development
w
re: getting a description for `@union`: feel free to change the API however you want
there is a bit of a convention of actually using the
__doc__
string for things
v1 `Task`s use the first line of their
__doc__
as their help
for example
h
but actually if I swap "description" for "__doc__" in the invcation of
project_str
, that also seems not to work
w
well, i might have made up "__doc__"... try it out in a repl =x
h
which makesme thing I'm doing something wrong with getting the Python object in
get_value_from_type_id
no it does seem like "__doc__" is the right python attr for a docstring I tried it
w
k
a
make sure it works in python too!! sometimes decorators don’t forward the docstring, and idk if i did that with @union
πŸ‘ 1
w
^
a
functools.wraps()
is the method to use in that case
πŸ‘ 1
w
alternatively, have the
def union
decorator actually set a real named property on the union
(using the doc)
and then read that.
but yea.
a
yes absolutely hack it in as necessary