@@ -135,7 +135,7 @@ def get_property_type(self, default_type: str | None, ctx: FunctionContext) -> s
135135
136136
137137def is_pybind11_overloaded_function_docstring (docstring : str , name : str ) -> bool :
138- return docstring .startswith (f"{ name } (*args, **kwargs)\n " + "Overloaded function.\n \n " )
138+ return docstring .startswith (f"{ name } (*args, **kwargs)\n Overloaded function.\n \n " )
139139
140140
141141def generate_stub_for_c_module (
@@ -417,6 +417,7 @@ def generate_module(self) -> None:
417417 ):
418418 self ._output .append ("\n " )
419419 self ._output .append (line + "\n " )
420+ self .check_undefined_names ()
420421
421422 def is_skipped_attribute (self , attr : str ) -> bool :
422423 return (
@@ -557,6 +558,7 @@ def generate_function_stub(
557558 if self .is_private_name (name , ctx .fullname ) or self .is_not_in_all (name ):
558559 return
559560
561+ self .record_name (ctx .name )
560562 default_sig = self .get_default_function_sig (obj , ctx )
561563 inferred = self .get_signatures (default_sig , self .sig_generators , ctx )
562564 self .process_inferred_sigs (inferred )
@@ -640,6 +642,7 @@ def generate_property_stub(
640642 if self .is_private_name (name , ctx .fullname ) or self .is_not_in_all (name ):
641643 return
642644
645+ self .record_name (ctx .name )
643646 static = self .is_static_property (raw_obj )
644647 readonly = self .is_property_readonly (raw_obj )
645648 if static :
@@ -718,6 +721,8 @@ def generate_class_stub(self, class_name: str, cls: type, output: list[str]) ->
718721 rw_properties : list [str ] = []
719722 ro_properties : list [str ] = []
720723 attrs : list [tuple [str , Any ]] = []
724+
725+ self .record_name (class_name )
721726 self .indent ()
722727
723728 class_info = ClassInfo (class_name , "" , getattr (cls , "__doc__" , None ), cls )
@@ -802,6 +807,7 @@ def generate_variable_stub(self, name: str, obj: object, output: list[str]) -> N
802807 """
803808 if self .is_private_name (name , f"{ self .module_name } .{ name } " ) or self .is_not_in_all (name ):
804809 return
810+ self .record_name (name )
805811 type_str = self .strip_or_import (self .get_type_annotation (obj ))
806812 output .append (f"{ name } : { type_str } " )
807813
0 commit comments