summaryrefslogtreecommitdiff
path: root/protocols.py
diff options
context:
space:
mode:
authorEevee (Alex Munroe) <amunroe@yelp.com>2014-07-31 16:32:21 -0700
committerEevee (Alex Munroe) <amunroe@yelp.com>2014-07-31 16:32:21 -0700
commit3a090e2819c85abacae5dd244733408cb110e427 (patch)
tree22afd25a9e0b62afb2c456c8f63fd2b69d597f02 /protocols.py
parent58e5e9774ba6a5cb378f2e30eb026489d66922fd (diff)
parentbf919348a823a573ebbb7c435626172ba21b7c3c (diff)
downloadastroid-git-3a090e2819c85abacae5dd244733408cb110e427.tar.gz
merged with default
Diffstat (limited to 'protocols.py')
-rw-r--r--protocols.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/protocols.py b/protocols.py
index f486e7cc..e1816a71 100644
--- a/protocols.py
+++ b/protocols.py
@@ -70,7 +70,7 @@ BIN_OP_IMPL = {'+': lambda a, b: a + b,
'^': lambda a, b: a ^ b,
'<<': lambda a, b: a << b,
'>>': lambda a, b: a >> b,
- }
+ }
for key, impl in BIN_OP_IMPL.items():
BIN_OP_IMPL[key+'='] = impl
@@ -166,7 +166,7 @@ def _resolve_looppart(parts, asspath, context):
assigned = stmt.getitem(index, context)
except (AttributeError, IndexError):
continue
- except TypeError, exc: # stmt is unsubscriptable Const
+ except TypeError: # stmt is unsubscriptable Const
continue
if not asspath:
# we achieved to resolved the assignment path,
@@ -231,10 +231,14 @@ def _arguments_infer_argname(self, name, context):
yield self.parent.parent.frame()
return
if name == self.vararg:
- yield const_factory(())
+ vararg = const_factory(())
+ vararg.parent = self
+ yield vararg
return
if name == self.kwarg:
- yield const_factory({})
+ kwarg = const_factory({})
+ kwarg.parent = self
+ yield kwarg
return
# if there is a default value, yield it. And then yield YES to reflect
# we can't guess given argument value