abstractmethod is not defined
I cannot run this code, because I get exception:

    NameError: name 'abstractmethod' is not defined
    File "C:\Tests\trunk\PythonTests\AbstractClasses.py", line 12, in <module>
      class MyIterable:
    File "C:\Tests\trunk\PythonTests\AbstractClasses.py", line 15, in MyIterable
      @abstractmethod

    from abc import ABCMeta
    
    class Foo(object):
        def __getitem__(self, index):
            print '__get_item__ Foo'
        def __len__(self):
            print '__len__ Foo'
        def get_iterator(self):
            print 'get_iterator Foo'
            return iter(self)
    
    class MyIterable:
        __metaclass__ = ABCMeta
    
        @abstractmethod
        def __iter__(self):
            while False:
                yield None
    
        def get_iterator(self):
            return self.__iter__()
    
        @classmethod
        def __subclasshook__(cls, C):
            if cls is MyIterable:
                if any("__iter__" in B.__dict__ for B in C.__mro__):
                    return True
            return NotImplemented
    
    MyIterable.register(Foo)
    
    x=Foo()
    x.__subclasshook__()



I'm sure that code is ok, because I got it from :
[enter link description here][1]


  [1]: http://docs.python.org/library/abc.html
abstractmethod is not defined
===

I cannot run this code, because I get exception:

    NameError: name 'abstractmethod' is not defined
    File "C:\Tests\trunk\PythonTests\AbstractClasses.py", line 12, in <module>
      class MyIterable:
    File "C:\Tests\trunk\PythonTests\AbstractClasses.py", line 15, in MyIterable
      @abstractmethod

    from abc import ABCMeta
    
    class Foo(object):
        def __getitem__(self, index):
            print '__get_item__ Foo'
        def __len__(self):
            print '__len__ Foo'
        def get_iterator(self):
            print 'get_iterator Foo'
            return iter(self)
    
    class MyIterable:
        __metaclass__ = ABCMeta
    
        @abstractmethod
        def __iter__(self):
            while False:
                yield None
    
        def get_iterator(self):
            return self.__iter__()
    
        @classmethod
        def __subclasshook__(cls, C):
            if cls is MyIterable:
                if any("__iter__" in B.__dict__ for B in C.__mro__):
                    return True
            return NotImplemented
    
    MyIterable.register(Foo)
    
    x=Foo()
    x.__subclasshook__()



I'm sure that code is ok, because I got it from :
[enter link description here][1]


  [1]: http://docs.python.org/library/abc.html