Problems with Python IDLE

Giraffe kerstin.viltersten at semcon.com
Tue May 27 04:54:36 EDT 2008


I have the followong class in a file:
--------------------------------------------
class someClass:
   def __init__ (self):
      self.someVar = 10

   def getSomeVar (self):
      return self.someVar
--------------------------------------------

In another file a do the following:
--------------------------------------------
tmp = someClass ()
tmp.getSomeVar ()
--------------------------------------------

I run the second file in the IDLE environment and everything seems to
be working fine until I start to modify in the first file:
--------------------------------------------
class someClass:
   def __init__ (self):
      self.someVar = 10

   def getSomeVar (self):
      print "Modified class!"
      return self.someVar
-------------------------------------------

When I now try to run the second file in the IDLE environment again, I
DO NOT get the newly added printout. I have saved and compiled (run)
both files but there is still no change. What have I missed?




More information about the Python-list mailing list