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')
4
  • stackoverflow.com/questions/4714136/… Commented Jan 21, 2015 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. Commented Jan 21, 2015 at 14:48
  • And so? What is missing in this for the behavior you want? Just the words "pure " and "virtual"? Commented Jan 21, 2015 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. Commented Jan 21, 2015 at 15:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.