diff options
| author | Claudiu Popa <pcmanticore@gmail.com> | 2016-08-24 11:08:05 +0300 |
|---|---|---|
| committer | Claudiu Popa <pcmanticore@gmail.com> | 2016-08-24 11:14:41 +0300 |
| commit | e9e2f54f27baeecc009c1f6a30baf80143d9ca2d (patch) | |
| tree | 30e281cd3ef975bd83a4f08c3ca73330045ec69f | |
| parent | ccefd3b1c3c4a712eb34313f6841ac36dc2f76da (diff) | |
| download | astroid-git-e9e2f54f27baeecc009c1f6a30baf80143d9ca2d.tar.gz | |
Export two helpers for verifying the type of a spec.
| -rw-r--r-- | astroid/modutils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/astroid/modutils.py b/astroid/modutils.py index 80a88e68..bbfaf81b 100644 --- a/astroid/modutils.py +++ b/astroid/modutils.py @@ -630,3 +630,10 @@ def _has_init(directory): if os.path.exists(mod_or_pack + '.' + ext): return mod_or_pack + '.' + ext return None + + +def is_namespace(specobj): + return specobj.type == spec.ModuleType.PY_NAMESPACE + +def is_directory(specobj): + return specobj.type == spec.ModuleType.PKG_DIRECTORY |
