python-record-api icon indicating copy to clipboard operation
python-record-api copied to clipboard

Put types in parent modules

Open saulshanabrook opened this issue 5 years ago • 1 comments

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.

saulshanabrook avatar Jun 16 '20 20:06 saulshanabrook

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!

saulshanabrook avatar Jul 01 '20 13:07 saulshanabrook