summaryrefslogtreecommitdiff
path: root/astroid/arguments.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/arguments.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/arguments.py')
-rw-r--r--astroid/arguments.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/astroid/arguments.py b/astroid/arguments.py
index 5670fa86..a0ffe739 100644
--- a/astroid/arguments.py
+++ b/astroid/arguments.py
@@ -44,11 +44,11 @@ class CallSite(object):
self.positional_arguments = [
arg for arg in self._unpacked_args
- if arg is not util.YES
+ if arg is not util.Uninferable
]
self.keyword_arguments = {
key: value for key, value in self._unpacked_kwargs.items()
- if value is not util.YES
+ if value is not util.Uninferable
}
@classmethod
@@ -87,29 +87,29 @@ class CallSite(object):
try:
inferred = next(value.infer(context=context))
except exceptions.InferenceError:
- values[name] = util.YES
+ values[name] = util.Uninferable
continue
if not isinstance(inferred, nodes.Dict):
# Not something we can work with.
- values[name] = util.YES
+ values[name] = util.Uninferable
continue
for dict_key, dict_value in inferred.items:
try:
dict_key = next(dict_key.infer(context=context))
except exceptions.InferenceError:
- values[name] = util.YES
+ values[name] = util.Uninferable
continue
if not isinstance(dict_key, nodes.Const):
- values[name] = util.YES
+ values[name] = util.Uninferable
continue
if not isinstance(dict_key.value, six.string_types):
- values[name] = util.YES
+ values[name] = util.Uninferable
continue
if dict_key.value in values:
# The name is already in the dictionary
- values[dict_key.value] = util.YES
+ values[dict_key.value] = util.Uninferable
self.duplicated_keywords.add(dict_key.value)
continue
values[dict_key.value] = dict_value
@@ -126,14 +126,14 @@ class CallSite(object):
try:
inferred = next(arg.value.infer(context=context))
except exceptions.InferenceError:
- values.append(util.YES)
+ values.append(util.Uninferable)
continue
- if inferred is util.YES:
- values.append(util.YES)
+ if inferred is util.Uninferable:
+ values.append(util.Uninferable)
continue
if not hasattr(inferred, 'elts'):
- values.append(util.YES)
+ values.append(util.Uninferable)
continue
values.extend(inferred.elts)
else: