Skip to content

Instantly share code, notes, and snippets.

@andrusha
Created June 30, 2011 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrusha/1055593 to your computer and use it in GitHub Desktop.
Save andrusha/1055593 to your computer and use it in GitHub Desktop.
inheritance example
In [1]: class Ellipse(object):
...: def setSize(self, x, y):
...: pass
...:
...:
In [2]: class Circle(Ellipse):
...: def setSize(self, x):
...: pass
...:
...:
In [3]: Ellipse().setSize(1,2)
In [4]: Circle().setSize(1)
In [5]: Circle().setSize(1,2)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/<ipython console> in <module>()
TypeError: setSize() takes exactly 2 arguments (3 given)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment