ipython / ipython/traitlets

Obscure error: <class ...> is not in list (class not in MRO)

Đang mở
#445 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
653
Fork
217
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
2

Mô tả

Hi all,

I'm experiencing a strange error related to some custom ipywidgets which I'm not even sure how to debug.

The first time with a new kernel that I instantiate this widget, it never throws an error. But the second or third time, it generally does. I haven't quite figured out the pattern.

The error is:
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
----> 1 wpw = WorkerPoolWidget()
2 wpw

~/local/miniconda3/envs/jupyter-hpc/lib/python3.6/site-packages/traitlets/traitlets.py in __new__(cls, *args, **kwargs)
956 else:
957 inst = new_meth(cls, *args, **kwargs)
--> 958 inst.setup_instance(*args, **kwargs)
959 return inst
960

~/local/miniconda3/envs/jupyter-hpc/lib/python3.6/site-packages/traitlets/traitlets.py in setup_instance(self, *args, **kwargs)
984 self._trait_notifiers = {}
985 self._trait_validators = {}
--> 986 super(HasTraits, self).setup_instance(*args, **kwargs)
987
988 def __init__(self, *args, **kwargs):

~/local/miniconda3/envs/jupyter-hpc/lib/python3.6/site-packages/traitlets/traitlets.py in setup_instance(self, *args, **kwargs)
975 else:
976 if isinstance(value, BaseDescriptor):
--> 977 value.instance_init(self)
978
979

~/local/miniconda3/envs/jupyter-hpc/lib/python3.6/site-packages/traitlets/traitlets.py in instance_init(self, obj)
2570 for trait in self._traits.values():
2571 trait.instance_init(obj)
-> 2572 super(Dict, self).instance_init(obj)
2573
2574

~/local/miniconda3/envs/jupyter-hpc/lib/python3.6/site-packages/traitlets/traitlets.py in instance_init(self, obj)
1690 def instance_init(self, obj):
1691 self._resolve_classes()
-> 1692 super(Instance, self).instance_init(obj)
1693
1694 def _resolve_classes(self):

~/local/miniconda3/envs/jupyter-hpc/lib/python3.6/site-packages/traitlets/traitlets.py in instance_init(self, obj)
518 # use provides a static default, transfer that to obj._trait_values.
519 with obj.cross_validation_lock:
--> 520 if (self._dynamic_default_callable(obj) is None) \
521 and (self.default_value is not Undefined):
522 v = self._validate(obj, self.default_value)

~/local/miniconda3/envs/jupyter-hpc/lib/python3.6/site-packages/traitlets/traitlets.py in _dynamic_default_callable(self, obj)
502 mro = type(obj).mro()
503 meth_name = '_%s_default' % self.name
--> 504 for cls in mro[:mro.index(self.this_class) + 1]:
505 if hasattr(cls, '_trait_default_generators'):
506 default_handler = cls._trait_default_generators.get(self.name)

ValueError: is not in list
```

I'm not sure how it would be that a class is not in its own method resolution order.

It occurs immediately on instantiation. I'm refraining from posting my code because it's quite long and mostly irrelevant. If anybody could out what could possibly cause this type of error, I may be able to write a concise piece of code which produces this error.

Thanks!
Oliver

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.