Conditions | 6 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | #!/usr/bin/env python |
||
7 | @public |
||
8 | def isexternalobject(obj, module): |
||
9 | if obj is None: |
||
10 | return |
||
11 | parent = inspect.getmodule(obj) |
||
12 | if parent == module: |
||
13 | return False |
||
14 | if parent: |
||
15 | return pkgname(module) != pkgname(parent) |
||
16 | # not object (variable?) |
||
17 | for _, _object in inspect.getmembers(module): |
||
18 | if _object == obj: |
||
19 | return False |
||
20 | return None # unknown |
||
21 |