Uh oh!
There was an error while loading. Please reload this page.
gh-104683: Argument clinic: make format_docstring() a method on Function objects - #107840
gh-104683: Argument clinic: make format_docstring() a method on Function objects#107840AlexWaygood wants to merge 3 commits into
format_docstring() a method on Function objects#107840Conversation
erlend-aasland
commented
Aug 10, 2023
Could you add tests for |
serhiy-storchaka
commented
Aug 10, 2023
I am not sure that it is a good idea. I do not see benefits from this change. |
erlend-aasland
commented
Aug 10, 2023
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. |
AlexWaygood
commented
Aug 10, 2023
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 |
serhiy-storchaka
commented
Aug 10, 2023
The problem is that
The |
AlexWaygood
commented
Aug 10, 2023
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 theFunctionobject that isself.functionon theDSLParser. It makes much more sense for it to be an instance method onFunctionobjects rather thanDSLParserobjects.Tools/clinic/#104683