Python ABC not working properly in Python 2.7.6? -
why can this?
from abc import abcmeta, abstractmethod class abstractclass(object): _metaclass__ = abcmeta @abstractmethod def foo(): pass @abstractmethod def bar(): pass class concreteclass(abstractclass): pass = abstractclass() nb = concreteclass()
there no error. runs perfectly. why can instantiate abtract class , why can instantiate object of concreteclass though did not implement abstract methods?
you missing _
__metaclass__ = abcmeta
Comments
Post a Comment