[Python-Dev] Re: Do we still need a support of non-type objects in issubclass()?

2020-10-06 Thread Random832
On Sat, Oct 3, 2020, at 04:41, Serhiy Storchaka wrote: > Should we continue to support non-type objects with __bases__ in > issubclass()? If no, can we remove their support in 3.10 (it would fix a > crash in issue41909) or after passing a deprecation period? Er, to be clear, contrary to the

[Python-Dev] Re: Do we still need a support of non-type objects in issubclass()?

2020-10-04 Thread Brett Cannon
On Sun, Oct 4, 2020 at 1:24 AM Serhiy Storchaka wrote: > 04.10.20 01:06, Guido van Rossum пише: > > On Sat, Oct 3, 2020 at 9:28 AM Serhiy Storchaka > > wrote: > > The code of object.__dir__() is very old, it predates new-style > classes, > > and currently it

[Python-Dev] Re: Do we still need a support of non-type objects in issubclass()?

2020-10-04 Thread Serhiy Storchaka
04.10.20 01:06, Guido van Rossum пише: > On Sat, Oct 3, 2020 at 9:28 AM Serhiy Storchaka > wrote: > The code of object.__dir__() is very old, it predates new-style classes, > and currently it gathers names using different algorithm than used in >

[Python-Dev] Re: Do we still need a support of non-type objects in issubclass()?

2020-10-03 Thread Guido van Rossum
On Sat, Oct 3, 2020 at 9:28 AM Serhiy Storchaka wrote: > 03.10.20 18:15, Guido van Rossum пише: > > Is this the only place where a non-class object with __bases__ is > > accepted? Or do we have more such? I recall that long ago you could use > > certain non-class objects as base classes. > > The

[Python-Dev] Re: Do we still need a support of non-type objects in issubclass()?

2020-10-03 Thread Serhiy Storchaka
03.10.20 18:15, Guido van Rossum пише: > Is this the only place where a non-class object with __bases__ is > accepted? Or do we have more such? I recall that long ago you could use > certain non-class objects as base classes. The only other place is object.__dir__(). It recursively iterates the

[Python-Dev] Re: Do we still need a support of non-type objects in issubclass()?

2020-10-03 Thread Guido van Rossum
Is this the only place where a non-class object with __bases__ is accepted? Or do we have more such? I recall that long ago you could use certain non-class objects as base classes. I think all that hackery may predate (and may even have been an inspiration for features of) new-style classes.

[Python-Dev] Re: Do we still need a support of non-type objects in issubclass()?

2020-10-03 Thread Serhiy Storchaka
03.10.20 12:45, Steven D'Aprano пише: > On Sat, Oct 03, 2020 at 11:41:16AM +0300, Serhiy Storchaka wrote: >> issubclass() accept types (extension types and new-style classes), >> classic classes and arbitrary objects with the __bases__ attribute as >> its arguments. > > I didn't think classic

[Python-Dev] Re: Do we still need a support of non-type objects in issubclass()?

2020-10-03 Thread Steven D'Aprano
On Sat, Oct 03, 2020 at 11:41:16AM +0300, Serhiy Storchaka wrote: > issubclass() accept types (extension types and new-style classes), > classic classes and arbitrary objects with the __bases__ attribute as > its arguments. I didn't think classic classes were still possible in Python 3. How do