@@ -948,6 +948,7 @@ def _get_obj_path(cls, target: Any) -> str:
948948
949949 Override this to control how `builds` determines the _target_ field
950950 in the configs that it produces."""
951+
951952 name = _utils .safe_name (target , repr_allowed = False )
952953
953954 if name == _utils .UNKNOWN_NAME :
@@ -986,12 +987,14 @@ def _get_obj_path(cls, target: Any) -> str:
986987
987988 if not _utils .is_classmethod (target ):
988989 if (
989- inspect .isfunction (target )
990+ ( inspect .isfunction (target ) or isinstance ( target , type ) )
990991 and isinstance (qualname , str )
991992 and "." in qualname
992993 and all (x .isidentifier () for x in qualname .split ("." ))
993994 ):
994- # this looks like it is a staticmethod. E.g. qualname: SomeClass.func
995+ # This looks like it is a staticmethod or a class defined within
996+ # a class namespace. E.g. qualname: SomeClass.func or
997+ # SomeClass.NestedClass
995998 return f"{ module } .{ qualname } "
996999 return f"{ module } .{ name } "
9971000 else :
@@ -1050,7 +1053,7 @@ def _mutable_value(cls, x: _T, *, zen_convert: Optional[ZenConvert] = None) -> _
10501053 @classmethod
10511054 def _make_hydra_compatible (
10521055 cls ,
1053- value : Any ,
1056+ value : object ,
10541057 * ,
10551058 allow_zen_conversion : bool = True ,
10561059 error_prefix : str = "" ,
@@ -1080,7 +1083,7 @@ def _make_hydra_compatible(
10801083 # We check exhaustively for all Hydra-supported primitives below but seek to
10811084 # speedup checks for common types here.
10821085 if value is None or type (value ) in {str , int , bool , float }:
1083- return value
1086+ return cast ( Union [ None , str , int , float , bool ], value )
10841087
10851088 # non-str collection
10861089 if hasattr (value , "__iter__" ):
@@ -1204,7 +1207,7 @@ def _make_hydra_compatible(
12041207 or isinstance (resolved_value , (Enum , ListConfig , DictConfig ))
12051208 )
12061209 ):
1207- return resolved_value
1210+ return resolved_value # type: ignore
12081211
12091212 # pydantic objects
12101213 pydantic = sys .modules .get ("pydantic" )
0 commit comments