245245 ),
246246]
247247
248- # Hack to get kwargs to appear in docstring #18434
249- # TODO: Remove when https://github.com/sphinx-doc/sphinx/pull/8234 gets
250- # merged
251- from sphinx .util import inspect # noqa
252- from sphinx .ext .autodoc import ClassDocumenter # noqa
253-
254-
255- class PatchedClassDocumenter (ClassDocumenter ):
256- def _get_signature (self ):
257- old_signature = inspect .signature
258-
259- def patch_signature (subject , bound_method = False , follow_wrapped = True ):
260- # changes the default of follow_wrapped to True
261- return old_signature (
262- subject ,
263- bound_method = bound_method ,
264- follow_wrapped = follow_wrapped ,
265- )
266-
267- inspect .signature = patch_signature
268- result = super ()._get_signature ()
269- inspect .signature = old_signature
270- return result
271-
248+ # -- Additional temporary hacks -----------------------------------------------
272249
273250# Temporary work-around for spacing problem between parameter and parameter
274251# type in the doc, see https://github.com/numpy/numpydoc/issues/215. The bug
@@ -277,6 +254,5 @@ def patch_signature(subject, bound_method=False, follow_wrapped=True):
277254# In an ideal world, this would get fixed in this PR:
278255# https://github.com/readthedocs/sphinx_rtd_theme/pull/747/files
279256def setup (app ):
280- app .registry .documenters ["class" ] = PatchedClassDocumenter
281257 app .add_js_file ("js/copybutton.js" )
282258 app .add_css_file ("basic.css" )
0 commit comments