forked from VimPlug/jedi
re-enable the interpretation of the None keyword
This commit is contained in:
@@ -13,7 +13,8 @@ def next(iterator, default=None):
|
|||||||
else:
|
else:
|
||||||
return iterator.__next__()
|
return iterator.__next__()
|
||||||
else:
|
else:
|
||||||
return default
|
if default is not None:
|
||||||
|
return default
|
||||||
|
|
||||||
|
|
||||||
def iter(collection, sentinel=None):
|
def iter(collection, sentinel=None):
|
||||||
|
|||||||
@@ -39,11 +39,6 @@ class NameFinder(object):
|
|||||||
|
|
||||||
@debug.increase_indent
|
@debug.increase_indent
|
||||||
def find(self, scopes, resolve_decorator=True, search_global=False):
|
def find(self, scopes, resolve_decorator=True, search_global=False):
|
||||||
if unicode(self.name_str) == 'None':
|
|
||||||
# Filter None, because it's really just a keyword, nobody wants to
|
|
||||||
# access it.
|
|
||||||
return []
|
|
||||||
|
|
||||||
names = self.filter_name(scopes)
|
names = self.filter_name(scopes)
|
||||||
types = self._names_to_types(names, resolve_decorator)
|
types = self._names_to_types(names, resolve_decorator)
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ next(reversed(arr))
|
|||||||
def yielder():
|
def yielder():
|
||||||
yield None
|
yield None
|
||||||
|
|
||||||
#?
|
#? None
|
||||||
next(reversed(yielder()))
|
next(reversed(yielder()))
|
||||||
|
|
||||||
# empty reversed should not raise an error
|
# empty reversed should not raise an error
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ There are three kinds of test:
|
|||||||
|
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
import jedi
|
import jedi
|
||||||
from jedi.api import classes
|
from jedi.api import classes
|
||||||
from jedi.evaluate import Evaluator
|
from jedi.evaluate import Evaluator
|
||||||
@@ -42,6 +44,7 @@ class MixinTestFullName(object):
|
|||||||
class TestFullNameWithGotoDefinitions(MixinTestFullName, TestCase):
|
class TestFullNameWithGotoDefinitions(MixinTestFullName, TestCase):
|
||||||
operation = 'goto_definitions'
|
operation = 'goto_definitions'
|
||||||
|
|
||||||
|
@pytest.mark.skipif('sys.version_info[:2] <= (2, 6)', reason='Python 2.6 also yields None.')
|
||||||
def test_tuple_mapping(self):
|
def test_tuple_mapping(self):
|
||||||
self.check("""
|
self.check("""
|
||||||
import re
|
import re
|
||||||
|
|||||||
Reference in New Issue
Block a user