[Python-Dev] Re: Where it is decided whether "lib" or "lib64" ends up in sys.path on a POSIX (non MacOS) system?

2020-10-03 Thread Nick Coghlan
The sysconfig & site modules cover the addition of non-stdlib directories to sys.path, but be aware that many Linux distros patch that logic to better align with the conventions of that particular distro. So your discrepancy is likely coming from either build process differences between the Debian

[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. —Gui

[Python-Dev] Where it is decided whether "lib" or "lib64" ends up in sys.path on a POSIX (non MacOS) system?

2020-10-03 Thread Mikhail Golubev via Python-Dev
Hi everyone! First of all, sorry for bringing up, perhaps, a trivial matter, but since it's about the sources I guess it's better to ask it here. I'm investigating a curious problem caused by the fact that in a user's virtualenv, created with the standard "venv" module, "lib64" directory, trad

[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 clas

[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 yo

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

2020-10-03 Thread Serhiy Storchaka
issubclass() accept types (extension types and new-style classes), classic classes and arbitrary objects with the __bases__ attribute as its arguments. The latter was added in issue464992 [1] to support the Zope extension ExtensionClass. I tested the current code of ExtensionClass [2], and seems i