AnemoneLabs / unmessage

Privacy enhanced instant messenger
GNU General Public License v3.0
43 stars 7 forks source link

Use attrs when a class calls `super` #50

Closed felipedau closed 7 years ago

felipedau commented 7 years ago

I could not use attrs in the Introduction class because it inherits from Thread and I have not found a way to call super. Example:

>>> @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

@meejah, do you have an idea on how to do this?

felipedau commented 7 years ago

As I continued working on #21, I noticed there was no need to subclass Thread in Introduction and now there is no need to fix this. Anyways, here is some useful info: