ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.81k stars 889 forks source link

pyln_client: (re-)adds method description to usage via docstring #7680

Open m-schmoock opened 1 day ago

m-schmoock commented 1 day ago

The extended usage information (long_description) has been removed a while ago without proper replacement. ( commit 2ff3e55f0 Date: Mon Jul 29 17:58:43 2024 -0700 )

This PR does the following:

m-schmoock commented 1 day ago

@cdecker Another option would be to reintroduce the description as a separate decorator to the method but do the same internal handling (appending to usage and passing to manifest json). Maybe that looks nicer in plugin code

rustyrussell commented 23 hours ago

We had to fix it quickly for the release, BUT the correct answer is to use the docstring! We already introspect, so accessing doc is easy (which always exists, but is None for no doc string).

m-schmoock commented 11 hours ago

We had to fix it quickly for the release, BUT the correct answer is to use the docstring! We already introspect, so accessing doc is easy (which always exists, but is None for no doc string).

Thanks for the clarification. I have been away from the project for a while as you know ;)

I rewrote the PR to use python docstring doc (if set) as the description.

m-schmoock commented 11 hours ago

We may want to extend the JSON schema to have the description as a separate field (and not internally newline concatenated to the usage). What do you think?