[Twisted-Python] How to call super() using attrs?
20 Jun
2017
20 Jun
'17
4:54 a.m.
I am trying to use attrs in a class that inherits from Thread but I have not found a way to call super(): >>> @attr.s ... class T(Thread, object): ... def __attr_post_init__(self): ... super(T, self).__init__() ... >>> t = T() >>> t.start() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/threading.py", line 737, in start raise RuntimeError("thread.__init__() not called") RuntimeError: thread.__init__() not called I even tried to call that in __attr_post_init__(), but maybe super() should be called in a pre-init method? Thanks, -Felipe
2501
Age (days ago)
2501
Last active (days ago)
0 comments
1 participants
participants (1)
-
Felipe Dau