[issue26306] Can't create abstract tuple
Jack Hargreaves
report at bugs.python.org
Mon Feb 8 07:21:53 EST 2016
New submission from Jack Hargreaves:
When creating an abstract class, subclassing tuple causes check for instantiation of an abstract class to be bypassed. See the associated stackoverflow question -- http://stackoverflow.com/questions/35267954/mix-in-of-abstract-class-and-namedtuple
from abc import abstractmethod, ABCMeta
class AbstactClass(tuple, metaclass=ABCMeta):
@abstractmethod
def some_method(self):
pass
# following should throw a TypeError, but doesn't
AbstactClass()
----------
messages: 259839
nosy: Jack Hargreaves
priority: normal
severity: normal
status: open
title: Can't create abstract tuple
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26306>
_______________________________________
More information about the Python-bugs-list
mailing list