Currently, we list the type where an object is defined as its module. However, many libraries define types in some sub-module but only expose them in a parent module.
So instead, when recording a type, we should look in all parent modules to see if they export this same type. If so, we should use that as the module name instead of where it is created.
Actually we should do this by relying on return type of getattr on modules... If we see a downstream thing getting an attribute of a module, that will be where the class is from!
Currently, we list the type where an object is defined as its module. However, many libraries define types in some sub-module but only expose them in a parent module.
So instead, when recording a type, we should look in all parent modules to see if they export this same type. If so, we should use that as the module name instead of where it is created.