1
0
forked from VimPlug/jedi

Fix namedtuple support

There were a couple issues:
 - namedtuple with one member didn't work
 - namedtuple content access was never possible
 - operator.itemgetter didn't work properly. Corrected py__bool__ for FakeSequence

Fixes #730.
This commit is contained in:
Dave Halter
2017-09-12 11:06:16 +02:00
parent 4a544c29ea
commit a8a15114ac
3 changed files with 61 additions and 5 deletions

View File

@@ -511,6 +511,9 @@ class FakeSequence(_FakeArray):
def py__iter__(self):
return self._lazy_context_list
def py__bool__(self):
return bool(len(self._lazy_context_list))
def __repr__(self):
return "<%s of %s>" % (type(self).__name__, self._lazy_context_list)