summaryrefslogtreecommitdiff
path: root/astroid/helpers.py
diff options
context:
space:
mode:
authorCeridwen <ceridwenv@gmail.com>2015-11-06 17:55:24 -0500
committerCeridwen <ceridwenv@gmail.com>2015-11-06 17:55:24 -0500
commit3ca0c7580187913bec11d0042a36906a2af36c91 (patch)
treec503daf5abd95f4cceac882761e927000ef65047 /astroid/helpers.py
parent797e89c30d44408a93b59489f79e5b69c5e124d1 (diff)
downloadastroid-git-3ca0c7580187913bec11d0042a36906a2af36c91.tar.gz
Rename Uninferable and instantiate_class, fix broken tests, improve
testing. * Rename YES to Uninferable * Rename instanciate_class to instantiate_class. * Use six in test_namedtuple_advanced_inference. * Fix test_file_from_module failure on PyPy. * Add enum34 to unittest_brain. * Add unittest_brain dependencies tox.ini.
Diffstat (limited to 'astroid/helpers.py')
-rw-r--r--astroid/helpers.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/astroid/helpers.py b/astroid/helpers.py
index 00f4784b..6d48b0da 100644
--- a/astroid/helpers.py
+++ b/astroid/helpers.py
@@ -86,7 +86,7 @@ def object_type(node, context=None):
This is used to implement the ``type`` builtin, which means that it's
used for inferring type calls, as well as used in a couple of other places
- in the inference.
+ in the inference.
The node will be inferred first, so this function can support all
sorts of objects, as long as they support inference.
"""
@@ -94,9 +94,9 @@ def object_type(node, context=None):
try:
types = set(_object_type(node, context))
except exceptions.InferenceError:
- return util.YES
+ return util.Uninferable
if len(types) > 1 or not types:
- return util.YES
+ return util.Uninferable
return list(types)[0]
@@ -140,7 +140,7 @@ def has_known_bases(klass, context=None):
def _type_check(type1, type2):
if not all(map(has_known_bases, (type1, type2))):
- return util.YES
+ return util.Uninferable
if not all([type1.newstyle, type2.newstyle]):
return False
@@ -148,7 +148,7 @@ def _type_check(type1, type2):
return type1 in type2.mro()[:-1]
except exceptions.MroError:
# The MRO is invalid.
- return util.YES
+ return util.Uninferable
def is_subtype(type1, type2):