[issue34760] Regression in abc in combination with issubclass

Christoph Glaubitz report at bugs.python.org
Fri Sep 21 04:28:36 EDT 2018


New submission from Christoph Glaubitz <chris+lp at chrigl.de>:

I'm not sure if this is a bug, or a known breaking change. I didn't find anything related in the changelog, except for a rewrite of abc. But hovever, I want this to be documented.

In 3.7.0:

import abc
def f():
    pass

class A(metaclass=abc.ABCMeta):
    pass

issubclass(f, A)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.7/abc.py", line 143, in __subclasscheck__
    return _abc_subclasscheck(cls, subclass)
TypeError: issubclass() arg 1 must be a class


python up to 3.6 (including 2.7) happily return false.

Found real world usage in osc-lib
* https://github.com/openstack/osc-lib/blob/46e2fb0a58fc06cfce1bb535f432405767d6b78b/osc_lib/utils/__init__.py#L495
* https://storyboard.openstack.org/#!/story/2003322

----------
messages: 325975
nosy: glaubich
priority: normal
severity: normal
status: open
title: Regression in abc in combination with issubclass
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34760>
_______________________________________


More information about the Python-bugs-list mailing list