forked from VimPlug/jedi
@@ -101,7 +101,9 @@ class TreeArguments(AbstractArguments):
|
|||||||
if self.argument_node is None:
|
if self.argument_node is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
if not (self.argument_node.type == 'arglist' or (
|
# Allow testlist here as well for Python2's class inheritance
|
||||||
|
# definitions.
|
||||||
|
if not (self.argument_node.type in ('arglist', 'testlist') or (
|
||||||
# in python 3.5 **arg is an argument, not arglist
|
# in python 3.5 **arg is an argument, not arglist
|
||||||
(self.argument_node.type == 'argument') and
|
(self.argument_node.type == 'argument') and
|
||||||
self.argument_node.children[0] in ('*', '**'))):
|
self.argument_node.children[0] in ('*', '**'))):
|
||||||
|
|||||||
@@ -215,6 +215,32 @@ class Dude(classgetter()):
|
|||||||
#? ['shout']
|
#? ['shout']
|
||||||
self.s
|
self.s
|
||||||
|
|
||||||
|
# -----------------
|
||||||
|
# multiple inheritance # 1071
|
||||||
|
# -----------------
|
||||||
|
|
||||||
|
class FactorMixin(object):
|
||||||
|
FACTOR_1 = 0.1
|
||||||
|
|
||||||
|
class Calc(object):
|
||||||
|
def sum(self, a, b):
|
||||||
|
self.xxx = 3
|
||||||
|
return a + b
|
||||||
|
|
||||||
|
class BetterCalc(Calc, FactorMixin):
|
||||||
|
def multiply_factor(self, a):
|
||||||
|
return a * self.FACTOR_1
|
||||||
|
|
||||||
|
calc = BetterCalc()
|
||||||
|
#? ['sum']
|
||||||
|
calc.sum
|
||||||
|
#? ['multiply_factor']
|
||||||
|
calc.multip
|
||||||
|
#? ['FACTOR_1']
|
||||||
|
calc.FACTOR_1
|
||||||
|
#? ['xxx']
|
||||||
|
calc.xxx
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# __call__
|
# __call__
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user