This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: `issubclass` on two different subclasses of abstract base class like `os.PathLike` returns unexpected value on early versions of Py3.7 and Py3.8
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, mobiusklein
Priority: normal Keywords:

Created on 2022-03-18 02:52 by mobiusklein, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg415467 - (view) Author: (mobiusklein) Date: 2022-03-18 02:52
The following code looks correct:

```python
import os

class A(os.PathLike):
    pass

class B(os.PathLike):
    pass

assert issubclass(A, os.PathLike) # direct inheritance relationship
assert issubclass(B, os.PathLike) # direct inheritance relationship
assert not issubclass(A, B) # A is not derived from B or vice-versa
```

On Python 3.7.0-3.7.6 and 3.8.0-3.8.1 the third assertion fails. The expected behavior was restored in 3.7.7 and 3.8.2. This seems to be around when the internals of `abc` were translated to C.

Given that the behavior was fixed, but a bug fix matching this behavior wasn't listed in the changelog, the only resolution is to document that this behavior may be extant in older but still supported minor versions of Python. Where should that text be placed?
msg415494 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2022-03-18 13:23
Since those releases are no longer supported, I don't think there's any place you could put this that would be seen. And we wouldn't want to put a note in a current release about a bug in a non-supported version that was fixed in another non-supported version.
msg415642 - (view) Author: (mobiusklein) Date: 2022-03-20 23:20
Understood. It's probably good practice to keep the interpreter version up to date in any case when debugging.
History
Date User Action Args
2022-04-11 14:59:57adminsetgithub: 91211
2022-03-20 23:20:36mobiuskleinsetstatus: open -> closed
resolution: works for me
messages: + msg415642

stage: resolved
2022-03-18 13:23:17eric.smithsetnosy: + eric.smith
messages: + msg415494
2022-03-18 02:52:35mobiuskleincreate