Closed erlend-aasland closed 1 year ago
I realised that the format_docstring()
helpers I introduced do not rely on self
; how about moving the whole docstring formatting over to Function, and do it at render time?
I realised that the
format_docstring()
helpers I introduced do not rely onself
; how about moving the whole docstring formatting over to Function, and do it at render time?
Makes sense to me!
It is weird that Function.render_parameters
is a property. It is named and used as a method. It is also called twice for each function; if we move the docstring rendering to render_function
, we only need to "call" render_parameters
once.
python/cpython#107623 (first step)
Based off of the
warn-and-fail
branch, hence the commit history. The new commit with theformat_docstring()
refactor is7ff262eb56752a78adfc99c2099b64cde1cb22e29df8da9168c5a45bba9bb09c614d328168edf34d.