@@ -230,6 +230,20 @@ def tutorials_download_error(record):
230230autodoc_docstring_signature = True
231231autodoc_default_options = {'members' :None ,'undoc-members' :None }
232232
233+
234+ def autodoc_process_bases (app ,name ,obj ,options ,bases ):
235+ """
236+ Hide pybind11 base object from inheritance tree.
237+
238+ Note, *bases* must be modified in place.
239+ """
240+ for cls in bases [:]:
241+ if not isinstance (cls ,type ):
242+ continue
243+ if cls .__module__ == 'pybind11_builtins' and cls .__name__ == 'pybind11_object' :
244+ bases .remove (cls )
245+
246+
233247# make sure to ignore warnings that stem from simply inspecting deprecated
234248# class-level attributes
235249warnings .filterwarnings ('ignore' ,category = DeprecationWarning ,
@@ -847,5 +861,6 @@ def setup(app):
847861bld_type = 'rel'
848862app .add_config_value ('skip_sub_dirs' ,0 ,'' )
849863app .add_config_value ('releaselevel' ,bld_type ,'env' )
864+ app .connect ('autodoc-process-bases' ,autodoc_process_bases )
850865if sphinx .version_info [:2 ]< (7 ,1 ):
851866app .connect ('html-page-context' ,add_html_cache_busting ,priority = 1000 )