title: Using abc.ABCMeta in a way it is compatible both with Python 2.7 and Python 3.5
body: <p>I'd like to create a class which has <code>abc.ABCMeta</code> as a metaclass and is compatible both with Python 2.7 and Python 3.5. Until now, I only succeeded doing this either on 2.7 or on 3.5 - but never on both versions simultaneously. Could someone give me a hand?</p>
  
  <p>Python 2.7:</p>
  
  <pre><code>import abc
  class SomeAbstractClass(object):
      __metaclass__ = abc.ABCMeta
      @abc.abstractmethod
      def do_something(self):
          pass
  </code></pre>
  
  <p>Python 3.5:</p>
  
  <pre><code>import abc
  class SomeAbstractClass(metaclass=abc.ABCMeta):
      @abc.abstractmethod
      def do_something(self):
          pass
  </code></pre>
  
  <h2>Testing</h2>
  
  <p>If we run the following test using the suitable version of the Python interpreter (Python 2.7 -> Example 1, Python 3.5 -> Example 2), it succeeds in both scenarios:</p>
  
  <pre><code>import unittest
  class SomeAbstractClassTestCase(unittest.TestCase):
      def test_do_something_raises_exception(self):
          with self.assertRaises(TypeError) as error:
              processor = SomeAbstractClass()
          msg = str(error.exception)
          expected_msg = "Can't instantiate abstract class SomeAbstractClass with abstract methods do_something"
          self.assertEqual(msg, expected_msg)
  </code></pre>
  
  <h2>Problem</h2>
  
  <p>While running the test using Python 3.5, the expected behavior doesn't happen (<code>TypeError</code> is not raised while instantiating <code>SomeAbstractClass</code>):</p>
  
  <pre><code>======================================================================
  FAIL: test_do_something_raises_exception (__main__.SomeAbstractClassTestCase)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/tati/sample_abc.py", line 22, in test_do_something_raises_exception
      processor = SomeAbstractClass()
  AssertionError: TypeError not raised
  
  ----------------------------------------------------------------------
  </code></pre>
  
  <p>Whereas running the test using Python 2.7 raises a <code>SyntaxError</code>:</p>
  
  <pre><code> Python 2.7 incompatible
   Raises exception:
    File "/home/tati/sample_abc.py", line 24
      class SomeAbstractClass(metaclass=abc.ABCMeta):
                                       ^
   SyntaxError: invalid syntax
  </code></pre>