Message213256
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 |
|
Date |
User |
Action |
Args |
2014-03-12 12:49:16 | the.mulhern | set | recipients:
+ the.mulhern |
2014-03-12 12:49:16 | the.mulhern | set | messageid: <1394628556.73.0.32604258797.issue20897@psf.upfronthosting.co.za> |
2014-03-12 12:49:16 | the.mulhern | link | issue20897 messages |
2014-03-12 12:49:16 | the.mulhern | create | |
|