0

I have not found how yet. Meanwhile am currently using like this:

@abc.abstractmethod
def pure_virtual_method(self, a, b):
    """
      Method description.
      :param a: Whatever...
      :param b: Whatever...
      :returns: Whatever...
    """
    #   This line should never be executed.
    raise NotImplementedError(
        'pure virtual method specification called instead of any '
        'implementation')
1737973
  • 159
  • 18
  • 42
  • http://stackoverflow.com/questions/4714136/python-how-to-implement-virtual-methods – Padraic Cunningham Jan 21 '15 at 14:45
  • 1
    Argh, I hate it when the better question has the worse or fewer answers. At least this question has made an attempt. – kojiro Jan 21 '15 at 14:48
  • And so? What is missing in this for the behavior you want? Just the words "pure " and "virtual"? – jsbueno Jan 21 '15 at 15:33
  • This would mean that after ten years I finally ended up learning how to develop, if it wasn't a snippet of code compliant with a language designed for its code to be canonical... It's more desirable annotating with something like '@abc.trulyabstractmethod', just using a 'pass' statement instead of raising an exception, requiring this syntax, and not letting the code start the execution, instead of raising an exception in a process already executing the user code. – 1737973 Jan 21 '15 at 15:48

0 Answers0