text: 35875/what-is-the-equivalent-of-notimplementederror-using-python
  Hi all. So basically I use Python 2.x
  And here, whenever we want to use a method which is abstract we define it as follows:
  class Base:
  def foo(self):
  raise NotImplementedError("Subclasses should implement this!")
  And later, let us say I forgot to override it. This is where I get the exception, right?
  IS there any nice way to consider a field to be marked as abstract? Or can it be done easily by changing and adding in the documentation string and considering that solves the issue?
  All help appreciated, cheers!
  Hi, good question!
  One simple answer to your question is YES! You can make use of the @property decorator just for this purpose.
  Consider this instance - Let us say you have a field called "example", then is almost not possible to do this:
  class Base(object):
  @property
  def example(self):
  raise NotImplementedError("Implement using Subclasses!")
  And basically running the below code gives you a NotImplementedError exactly as expected!
  c = Base()
  print c.example
  The main purpose of anonymous functions come ...READ MORE
  The SimpleHTTPServer module has been merged into http.server in Python 3.0. ...READ MORE
  Polymorphism is the ability to present the ...READ MORE
  python is general purpose programming language.it very ...READ MORE
  suppose you have a string with a ...READ MORE
  You can also use the random library's ...READ MORE
  Syntax :
  list. count(value)
  Code:
  colors = ['red', 'green', ...READ MORE
  Enumerate() method adds a counter to an ...READ MORE
  As far as I know, there is ...READ MORE
  Hi. Nice question.
  Here is the simplified answer ...READ MORE
  OR
  At least 1 upper-case and 1 lower-case letter
  Minimum 8 characters and Maximum 50 characters
  Already have an account? Sign in.