1
0
forked from VimPlug/jedi

Remove compatibility for zip_longest

This commit is contained in:
Dave Halter
2020-07-02 01:08:57 +02:00
parent 2aec4678da
commit b5e0c1e9c6
3 changed files with 4 additions and 10 deletions

View File

@@ -211,12 +211,6 @@ def literal_eval(string):
return ast.literal_eval(string) return ast.literal_eval(string)
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest # Python 2 # noqa: F401
def utf8_repr(func): def utf8_repr(func):
""" """
``__repr__`` methods in Python 2 don't allow unicode objects to be ``__repr__`` methods in Python 2 don't allow unicode objects to be

View File

@@ -1,8 +1,8 @@
import re import re
from itertools import zip_longest
from parso.python import tree from parso.python import tree
from jedi._compatibility import zip_longest
from jedi import debug from jedi import debug
from jedi.inference.utils import PushBackIterator from jedi.inference.utils import PushBackIterator
from jedi.inference import analysis from jedi.inference import analysis
@@ -189,8 +189,6 @@ class TreeArguments(AbstractArguments):
iterators = [_iterate_star_args(self.context, a, el, funcdef) iterators = [_iterate_star_args(self.context, a, el, funcdef)
for a in arrays] for a in arrays]
for values in list(zip_longest(*iterators)): for values in list(zip_longest(*iterators)):
# TODO zip_longest yields None, that means this would raise
# an exception?
yield None, get_merged_lazy_value( yield None, get_merged_lazy_value(
[v for v in values if v is not None] [v for v in values if v is not None]
) )

View File

@@ -8,10 +8,12 @@ just one.
""" """
from functools import reduce from functools import reduce
from operator import add from operator import add
from itertools import zip_longest
from parso.python.tree import Name from parso.python.tree import Name
from jedi import debug from jedi import debug
from jedi._compatibility import zip_longest, unicode from jedi._compatibility import unicode
from jedi.parser_utils import clean_scope_docstring from jedi.parser_utils import clean_scope_docstring
from jedi.inference.helpers import SimpleGetItemNotFound from jedi.inference.helpers import SimpleGetItemNotFound
from jedi.inference.utils import safe_property from jedi.inference.utils import safe_property