mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Fix issues with default parameters in functions and classes
Default parameters were resolved at the wrong starting position. Fixes #1044
This commit is contained in:
@@ -422,17 +422,18 @@ class Super(object):
|
||||
a = 3
|
||||
def return_sup(self):
|
||||
return 1
|
||||
SuperCopy = Super
|
||||
|
||||
class TestSuper(Super):
|
||||
#?
|
||||
super()
|
||||
def test(self):
|
||||
#? Super()
|
||||
#? SuperCopy()
|
||||
super()
|
||||
#? ['a']
|
||||
super().a
|
||||
if 1:
|
||||
#? Super()
|
||||
#? SuperCopy()
|
||||
super()
|
||||
def a():
|
||||
#?
|
||||
@@ -446,6 +447,17 @@ class TestSuper(Super):
|
||||
TestSuper().return_sup()
|
||||
|
||||
|
||||
Super = 3
|
||||
|
||||
class Foo():
|
||||
def foo(self):
|
||||
return 1
|
||||
# Somehow overwriting the same name caused problems (#1044)
|
||||
class Foo(Foo):
|
||||
def foo(self):
|
||||
#? int()
|
||||
super().foo()
|
||||
|
||||
# -----------------
|
||||
# if flow at class level
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user