Re: [Python-ideas] Thread.__init__ should call super()

2017-10-30 Thread Ilya Kulakov
Neil, thank you for doing much better job explaining the problem. Generally, I'm cool with Python's standard library classes not calling super(), as many of them are not designed for subclassing. But those which are should do that. E.g. take a look at more recent asyncio's Protocol and

Re: [Python-ideas] Thread.__init__ should call super()

2017-10-28 Thread Antoine Pitrou
On Fri, 27 Oct 2017 13:59:01 -0700 Ilya Kulakov 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. Not to derail this thread, but I find it much clearer to use

Re: [Python-ideas] Thread.__init__ should call super()

2017-10-28 Thread Neil Girdhar
On Sat, Oct 28, 2017 at 7:15 AM Steven D'Aprano wrote: > On Sat, Oct 28, 2017 at 12:14:31AM -0700, Neil Girdhar wrote: > > > > > > On Friday, October 27, 2017 at 8:05:17 PM UTC-4, Steven D'Aprano wrote: > > > > > > On Fri, Oct 27, 2017 at 01:59:01PM -0700, Ilya Kulakov

Re: [Python-ideas] Thread.__init__ should call super()

2017-10-28 Thread Steven D'Aprano
On Sat, Oct 28, 2017 at 12:14:31AM -0700, Neil Girdhar wrote: > > > On Friday, October 27, 2017 at 8:05:17 PM UTC-4, Steven D'Aprano wrote: > > > > On Fri, Oct 27, 2017 at 01:59:01PM -0700, Ilya Kulakov wrote: > > > > > Since one of the legit use-cases of using the Thread class is > >

Re: [Python-ideas] Thread.__init__ should call super()

2017-10-28 Thread Neil Girdhar
I meant: class SomeBase: def __init__(self, base_x, **kwargs): super().__init__(**kwargs) self.base_x = base_x On Saturday, October 28, 2017 at 3:14:31 AM UTC-4, Neil Girdhar wrote: > > > > On Friday, October 27, 2017 at 8:05:17 PM UTC-4, Steven D'Aprano wrote: >> >> On Fri,

Re: [Python-ideas] Thread.__init__ should call super()

2017-10-28 Thread Neil Girdhar
On Friday, October 27, 2017 at 8:05:17 PM UTC-4, Steven D'Aprano wrote: > > On Fri, Oct 27, 2017 at 01:59:01PM -0700, Ilya Kulakov 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 >

Re: [Python-ideas] Thread.__init__ should call super()

2017-10-28 Thread Neil Girdhar
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

Re: [Python-ideas] Thread.__init__ should call super()

2017-10-27 Thread Steven D'Aprano
On Fri, Oct 27, 2017 at 01:59:01PM -0700, Ilya Kulakov 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? Are you talking

Re: [Python-ideas] Thread.__init__ should call super()

2017-10-27 Thread Guido van Rossum
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):

[Python-ideas] Thread.__init__ should call super()

2017-10-27 Thread Ilya Kulakov
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