You can subclass Thread just fine, you just can't have it in a multiple
inheritance hierarchy except at the end of the MRO (before object). That
shouldn't stop you from doing anything you want though -- you can define
e.g.

class MyThread(Thread):
    def __init__(self, *args, **kwds):
        Thread.__init__(self, *args, **kwds)
        super(Thread, self).__init__(*args, **kwds)

and use this class instead of Thread everywhere. (You'll have to decide
which arguments to pass on and which ones to ignore, but that's not
specific to the issue of Thread.)

Of course you're probably better off not trying to be so clever.

On Fri, Oct 27, 2017 at 1:59 PM, Ilya Kulakov <kulakov.i...@gmail.com>
wrote:

> Since one of the legit use-cases of using the Thread class is subclassing,
> I think it's __init__ should call super() to support cooperative
> inheritance.
>
> Or perhaps there is a good reason for not doing so?
>
> Best Regards,
> Ilya Kulakov
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
>


-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to