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 terry.reedy, the.mulhern
Date 2014-03-18.13:44:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1395150283.32.0.373723630382.issue20897@psf.upfronthosting.co.za>
In-reply-to
Content
I feel that I worded this in a way that makes it look like I'm asking for an enhancement, not reporting a bug, so I'll try again.

The documentation for 2.7.6 and 3.4.0 says:

Using this decorator requires that the class’s metaclass is ABCMeta or is derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract methods and properties are overridden. The abstract methods can be called using any of the normal ‘super’ call mechanisms.

The second sentence is a little obscure, but what it must mean is that a class that has a metaclass derived from ABCMeta or a class that extends such a class cannot be instantiated unless all of its abstract method and properties are overridden.

Now, in this example, both Sub and SuperSubber have an abstract method _junk(self) and neither of them overrides this method. Therefore, neither should be instantiated.

But they can both be instantiated in 3.3 and one can be instantiated in 2.7.

So, the behavior does seem to me to disagree with the documentation.

In fact, in Python 3.3.2 I can instantiate the META class in the example, which seems really wrong. I can not instantiate the META class in 2.7.6.
History
Date User Action Args
2014-03-18 13:44:43the.mulhernsetrecipients: + the.mulhern, terry.reedy
2014-03-18 13:44:43the.mulhernsetmessageid: <1395150283.32.0.373723630382.issue20897@psf.upfronthosting.co.za>
2014-03-18 13:44:43the.mulhernlinkissue20897 messages
2014-03-18 13:44:42the.mulherncreate