New submission from Christoph Glaubitz <chris...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue34760>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to