[Python-ideas] Thread.__init__ should call super()
Neil Girdhar
mistersheik at gmail.com
Sat Oct 28 03:21:53 EDT 2017
More information about the Python-ideas mailing list
Sat Oct 28 03:21:53 EDT 2017
- Previous message (by thread): [Python-ideas] Thread.__init__ should call super()
- Next message (by thread): [Python-ideas] Thread.__init__ should call super()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Out of curiosity, what is the benefit of not calling super from Thread.__init__? On Friday, October 27, 2017 at 7:29:17 PM UTC-4, Guido van Rossum wrote: > > 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 <kulako... at gmail.com > <javascript:>> 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... at python.org <javascript:> >> https://mail.python.org/mailman/listinfo/python-ideas >> Code of Conduct: http://python.org/psf/codeofconduct/ >> >> > > > -- > --Guido van Rossum (python.org/~guido) > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171028/d2a0e7bc/attachment-0001.html>
- Previous message (by thread): [Python-ideas] Thread.__init__ should call super()
- Next message (by thread): [Python-ideas] Thread.__init__ should call super()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list