-
-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-104683: Argument clinic: make format_docstring()
a method on Function
objects
#107840
Conversation
Could you add tests for |
I am not sure that it is a good idea. I do not see benefits from this change. |
IMO, it makes most sense to render (and format) the docstring in Regarding where the docstring render code should live: perhaps a DocstringRenderer class that can take care of this is the best option. I see the value of keeping the Function class small. No matter where it ends up, I think it makes sense to tear this functionality out of the parser. |
Since the However, it is true that this PR does not fix any known bugs, so if we disagree that this improves readability, then it should be abandoned. It's also true that this would be a significant increase in the complexity of the
It's true that these facts about |
The problem is that
The |
Thanks @serhiy-storchaka, that seems like a solid analysis. Let's leave this for now, then, and save it for a more principled refactor. |
format_docstring()
only ever modifies the internal state of theFunction
object that isself.function
on theDSLParser
. It makes much more sense for it to be an instance method onFunction
objects rather thanDSLParser
objects.Tools/clinic/
#104683