Re: [Tutor] : unexpected behavior with assignment in __init__

2006-01-25 Thread Orri Ganel
Kent Johnson wrote: variable, it has no effect outside the method; inside a method, self is just a method parameter, nothing more. There is some magic that gives self its value for the call. When __init__() is called the new instance has already been created, you are just initializing it

Re: [Tutor] : unexpected behavior with assignment in __init__

2006-01-25 Thread Kent Johnson
Orri Ganel wrote: > Hello all, > I was just messing around with a suggestion w chun (wescpy at gmail > dot com) gave (to make a class that handles time, ie: > >> >> import myTime >> >> c = myTime.myTime(10,30) >> >> print c > 10:30 >> >> d = myTime.myTime(8,45) >> >> print c + d > 19:15 > >

[Tutor] : unexpected behavior with assignment in __init__

2006-01-24 Thread Orri Ganel
Hello all,     I was just messing around with a suggestion w chun (wescpy at gmail dot com) gave (to make a class that handles time, ie: >>> import myTime >>> c = myTime.myTime(10,30) >>> print c 10:30 >>> d = myTime.myTime(8,45) >>> print c + d 19:15 etc), and I was trying to make it like th