cleanvision icon indicating copy to clipboard operation
cleanvision copied to clipboard

create a mypy type for imagelab.info

Open sanjanag opened this issue 1 year ago • 2 comments

imagelab.info is an Imagelab class attribute designed to be a nested dictionary containing information relevant to the computation of issue types. Right now the type assigned to imagelab.info is Dict[str, Any] which is very loose. The task is to define a type alias for the variable that is tight in its definition and replaces the Any with the actual types that could be present in the dictionary. Check this link for more details on how to create type aliases. Refer to the documentation for more details on imagelab.info.

sanjanag avatar Mar 15 '23 19:03 sanjanag

Hi @sanjanag , can we use Dict[str, Dict[str, Any] for imagelab.info ?

Kadam-Tushar avatar Apr 16 '23 14:04 Kadam-Tushar

Hi @Kadam-Tushar ! The idea for creating a type for imagelab.info is that we pin down every type of object that can be present in the Dict, removing the use of Any.

sanjanag avatar Apr 21 '23 16:04 sanjanag