Re: [Tutor] Working with Python Objects

2008-03-16 Thread Alan Gauld
"Dinesh B Vadhia" <[EMAIL PROTECTED]> wrote > I've combined your code fragments and added a function > call too, to determine how 'a' is passed between objects > and classes: - class A: def oneA(self): z = 2 self.a = self.a * z class B: def oneB

Re: [Tutor] Working with Python Objects

2008-03-15 Thread Dinesh B Vadhia
Alan/Greg I've combined your code fragments and added a function call too, to determine how 'a' is passed between objects and classes: def addNumbers(i, j): k = i + j return k class A: def oneA(self): z = 2 self.a = self.a * z class B: def oneB(self): in

Re: [Tutor] Working with Python Objects

2008-03-14 Thread Alan Gauld
"Dinesh B Vadhia" <[EMAIL PROTECTED]> wrote class A: constantA = 9 def OneOfA: a = class B: variableB = "quick brown fox" def OneOfB: b = c = b * a# the 'a' from def OneOfA in class

Re: [Tutor] Working with Python Objects

2008-03-14 Thread Greg Graham
Dinesh wrote: > I've avoided it as long as possible but I've reached a stage where I have to > start using Python objects! The primary reason is that the web framework uses > objects and the second is to eliminate a few globals. Here is example pseudo > code followed by the question (one of many

[Tutor] Working with Python Objects

2008-03-14 Thread Dinesh B Vadhia
I've avoided it as long as possible but I've reached a stage where I have to start using Python objects! The primary reason is that the web framework uses objects and the second is to eliminate a few globals. Here is example pseudo code followed by the question (one of many I suspect!): class