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.

Author the.mulhern
Recipients the.mulhern
Date 2014-03-12.12:49:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1394628556.73.0.32604258797.issue20897@psf.upfronthosting.co.za>
In-reply-to
Content
Hi!

Here is a simple class hierarchy:

>>> import abc
>>> class META(object):
...     __metaclass__ = abc.ABCMeta
...     @abc.abstractmethod
...     def _junk(self):
...             pass
... 
>>> class Sub(META):
...     def _junk(self, other):
...             pass
... 
>>> class Subber(META):
...     def _junk(self):
...             pass
... 
>>> class SuperSubber(META):
...     pass
... 

In 2.7.5 I can instantiate an object of Sub or Subber, although Sub does not really override META's abstract method.
I think it would be better if I could not instantiate Sub, because the signature of the abstract method in META
is different from the signature of the overriding method in Sub.
I can not instantiate SuperSubber, I get a TypeError. That seems correct.

In 3.3.2 I can instantiate all three, Sub, Subber, and SuperSubber.
I would prefer to only be able to instantiate Subber, since it is the only class that truly overrides the abstract method
_junk in META.

- mulhern
History
Date User Action Args
2014-03-12 12:49:16the.mulhernsetrecipients: + the.mulhern
2014-03-12 12:49:16the.mulhernsetmessageid: <1394628556.73.0.32604258797.issue20897@psf.upfronthosting.co.za>
2014-03-12 12:49:16the.mulhernlinkissue20897 messages
2014-03-12 12:49:16the.mulherncreate