forked from VimPlug/jedi
Get rid of the None default for memoize_default. It shouldn't have a default if not given. This also uncovered a bug in for/else loops, that wasn't teste before.
This commit is contained in:
@@ -9,7 +9,7 @@ import inspect
|
||||
NO_DEFAULT = object()
|
||||
|
||||
|
||||
def memoize_default(default=None, evaluator_is_first_arg=False, second_arg_is_evaluator=False):
|
||||
def memoize_default(default=NO_DEFAULT, evaluator_is_first_arg=False, second_arg_is_evaluator=False):
|
||||
""" This is a typical memoization decorator, BUT there is one difference:
|
||||
To prevent recursion it sets defaults.
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ def _name_to_types(evaluator, name, scope):
|
||||
types = []
|
||||
typ = name.get_definition()
|
||||
if typ.isinstance(pr.ForStmt):
|
||||
for_types = evaluator.eval_element(typ.children[-3])
|
||||
for_types = evaluator.eval_element(typ.children[3])
|
||||
for_types = iterable.get_iterator_types(for_types)
|
||||
types += check_tuple_assignments(for_types, name)
|
||||
elif typ.isinstance(pr.CompFor):
|
||||
|
||||
@@ -105,6 +105,13 @@ for i in b:
|
||||
#? float() str()
|
||||
a[0]
|
||||
|
||||
for i in [1,2,3]:
|
||||
#? int()
|
||||
i
|
||||
else:
|
||||
i
|
||||
|
||||
|
||||
# -----------------
|
||||
# range()
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user