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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -