Skip to content

Commit 328b5ea

Browse files
committed
updated to release Jedi 0.10.0
1 parent 54415cb commit 328b5ea

4 files changed

Lines changed: 13 additions & 30 deletions

File tree

‎pythonFiles/preview/jedi/api/classes.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def params(self):
332332
def get_param_names(context):
333333
param_names = []
334334
if context.api_type == 'function':
335-
param_names = context.get_param_names()
335+
param_names = list(context.get_param_names())
336336
if isinstance(context, instance.BoundMethod):
337337
param_names = param_names[1:]
338338
elif isinstance(context, (instance.AbstractInstanceContext, er.ClassContext)):
@@ -347,9 +347,12 @@ def get_param_names(context):
347347
# Just take the first one here, not optimal, but currently
348348
# there's no better solution.
349349
inferred = names[0].infer()
350-
return get_param_names(next(iter(inferred)))
350+
param_names = get_param_names(next(iter(inferred)))
351+
if isinstance(context, er.ClassContext):
352+
param_names = param_names[1:]
353+
return param_names
351354
elif isinstance(context, compiled.CompiledObject):
352-
return context.get_param_names()
355+
return list(context.get_param_names())
353356
return param_names
354357

355358
followed = list(self._name.infer())

‎pythonFiles/preview/jedi/evaluate/representation.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
descriptors.
3535
====================================== ========================================
3636
37-
__
3837
"""
3938
import os
4039
import pkgutil

‎pythonFiles/preview/jedi/parser/diff.py‎

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -124,28 +124,6 @@ def _reset(self):
124124
self._new_used_names = {}
125125
self._nodes_stack = _NodesStack(self._module)
126126

127-
def __update(self, lines_new):
128-
"""For now we use this function for better error reporting."""
129-
old_source = self._parser.source
130-
try:
131-
return self._update(lines_new)
132-
except Exception:
133-
# Only log for linux, it's easier.
134-
import sys
135-
if 'linux' in sys.platform:
136-
lines_old = splitlines(old_source, keepends=True)
137-
import traceback
138-
with open('/tmp/jedi_error.log', 'w') as f:
139-
f.write(
140-
'parser issue, please report:\n%s\n%s\n%s' % (
141-
repr(''.join(lines_old)),
142-
repr(''.join(lines_new)),
143-
traceback.format_exc()
144-
)
145-
)
146-
raise Exception("There's a parser issue. Please report /tmp/jedi_error.log")
147-
raise
148-
149127
def update(self, lines_new):
150128
'''
151129
The algorithm works as follows:
@@ -177,9 +155,15 @@ def update(self, lines_new):
177155
line_length = len(lines_new)
178156
lines_old = splitlines(self._parser.source, keepends=True)
179157
sm = difflib.SequenceMatcher(None, lines_old, self._parser_lines_new)
158+
opcodes = sm.get_opcodes()
180159
debug.speed('diff parser calculated')
181160
debug.dbg('diff: line_lengths old: %s, new: %s' % (len(lines_old), line_length))
182-
for operation, i1, i2, j1, j2 in sm.get_opcodes():
161+
162+
if len(opcodes) == 1 and opcodes[0][0] == 'equal':
163+
self._copy_count = 1
164+
return self._module
165+
166+
for operation, i1, i2, j1, j2 in opcodes:
183167
debug.dbg('diff %s old[%s:%s] new[%s:%s]',
184168
operation, i1 + 1, i2, j1 + 1, j2)
185169

@@ -436,8 +420,6 @@ def close(self):
436420
def add(self, children, line_offset=0, last_line_offset_leaf=None):
437421
group = self.ChildrenGroup(children, line_offset, last_line_offset_leaf)
438422
self.children_groups.append(group)
439-
if len(self.children_groups) > 42:
440-
raise NotImplementedError
441423

442424
def get_last_line(self, suffix):
443425
if not self.children_groups:

‎pythonFiles/preview/jedi/settings.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
.. autodata:: max_function_recursion_level
6363
.. autodata:: max_executions_without_builtins
6464
.. autodata:: max_executions
65-
.. autodata:: max_dynamic_params_depth
6665
.. autodata:: scale_call_signatures
6766
6867

0 commit comments

Comments
 (0)