mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Fix infer_default for params in REPL, fixes #1738
This commit is contained in:
@@ -414,6 +414,9 @@ class ParamNameInterface(_ParamMixin):
|
||||
return 2
|
||||
return 0
|
||||
|
||||
def infer_default(self):
|
||||
return NO_VALUES
|
||||
|
||||
|
||||
class BaseTreeParamName(ParamNameInterface, AbstractTreeName):
|
||||
annotation_node = None
|
||||
|
||||
@@ -732,3 +732,10 @@ def test_complete_not_findable_class_source():
|
||||
|
||||
assert "ta" in [c.name for c in completions]
|
||||
assert "ta1" in [c.name for c in completions]
|
||||
|
||||
|
||||
def test_param_infer_default():
|
||||
abs_sig, = jedi.Interpreter('abs(', [{'abs': abs}]).get_signatures()
|
||||
param, = abs_sig.params
|
||||
assert param.name == 'x'
|
||||
assert param.infer_default() == []
|
||||
|
||||
Reference in New Issue
Block a user