mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-17 05:49:37 +08:00
Fix mro detail
This commit is contained in:
@@ -155,7 +155,7 @@ class ClassMixin(object):
|
|||||||
# TODO detect for TypeError: duplicate base class str,
|
# TODO detect for TypeError: duplicate base class str,
|
||||||
# e.g. `class X(str, str): pass`
|
# e.g. `class X(str, str): pass`
|
||||||
try:
|
try:
|
||||||
cls.py__bases__
|
mro_method = cls.py__mro__
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# TODO add a TypeError like:
|
# TODO add a TypeError like:
|
||||||
"""
|
"""
|
||||||
@@ -170,10 +170,8 @@ class ClassMixin(object):
|
|||||||
"""
|
"""
|
||||||
debug.warning('Super class of %s is not a class: %s', self, cls)
|
debug.warning('Super class of %s is not a class: %s', self, cls)
|
||||||
else:
|
else:
|
||||||
if cls not in mro:
|
for cls_new in mro_method():
|
||||||
mro.append(cls)
|
if cls_new not in mro:
|
||||||
yield cls
|
|
||||||
for cls_new in cls.py__mro__():
|
|
||||||
mro.append(cls_new)
|
mro.append(cls_new)
|
||||||
yield cls_new
|
yield cls_new
|
||||||
|
|
||||||
@@ -245,6 +243,9 @@ class ClassContext(use_metaclass(CachedMetaClass, ClassMixin, TreeContext)):
|
|||||||
args = arguments.TreeArguments(self.evaluator, self.parent_context, arglist)
|
args = arguments.TreeArguments(self.evaluator, self.parent_context, arglist)
|
||||||
return [value for key, value in args.unpack() if key is None]
|
return [value for key, value in args.unpack() if key is None]
|
||||||
else:
|
else:
|
||||||
|
if self.py__name__() == 'object' \
|
||||||
|
and self.parent_context == self.evaluator.builtins_module:
|
||||||
|
return []
|
||||||
return [LazyKnownContexts(
|
return [LazyKnownContexts(
|
||||||
self.evaluator.builtins_module.py__getattribute__('object')
|
self.evaluator.builtins_module.py__getattribute__('object')
|
||||||
)]
|
)]
|
||||||
|
|||||||
Reference in New Issue
Block a user