title: Delete an instance of the object
body: <p>I'm trying to understand the class notion in Python and having decided to do a little exercise I found myself facing a problem.</p>
  
  <p>What I'm trying to do is to create a circle (on a left-click) and then I expect the program to delete the circle (on a right-click). </p>
  
  <p>Well, here comes the second part of my problem.</p>
  
  <p>My code:</p>
  
  <pre><code>from tkinter import *
  
  class Application:
      def __init__(self):
          self.fen = Tk()
          self.fen.title('Rom-rom-roooooom')
          self.butt1 = Button(self.fen, text = ' Quit ', command = self.fen.quit)
          self.can1 = Canvas(self.fen, width = 300, height = 300, bg = 'ivory')
          self.can1.grid(row = 1)
          self.butt1.grid(row = 2)
          self.fen.bind("&lt;Button-1&gt;", self.create_obj)
          self.fen.bind("&lt;Button-3&gt;", self.delete_obj)
          self.fen.mainloop()
      def create_obj(self, event):
          self.d = Oval()
          self.can1.create_oval(self.d.x1, self.d.y1, self.d.x2, self.d.y2, fill='red', width = 2)
      def delete_obj(self, event):
          self.can1.delete(self.d)
  
  
  class Oval:
  
      def __init__(self):
          self.x1 = 50
          self.y1 = 50
          self.x2 = 70
          self.y2 = 70
  
  
  appp = Application()
  </code></pre>
  
  <p>Here, the program understands that 'd' is an instance of class Oval, but it doesn't delete the object on a right click:</p>
  
  <pre><code>def delete_obj(self, event):
      self.can1.delete(self.d) 
  </code></pre>