Re: Instance variables question

2018-04-16 Thread Steven D'Aprano
On Mon, 16 Apr 2018 09:03:47 -0700, Irv Kalb wrote: > I have been writing OOP code for many years in other languages and for > the past few years in Python. I am writing new curriculum for a course > on OOP in Python. If you're going to be teaching Python, please don't teach terminology which

Re: Instance variables question

2018-04-16 Thread Peter Otten
Chris Angelico wrote: > On Tue, Apr 17, 2018 at 3:34 AM, Peter Otten <__pete...@web.de> wrote: >> Irv Kalb wrote: >> >>> I have been writing OOP code for many years in other languages and for >>> the >>> past few years in Python. I am writing new curriculum for a course on >>> OOP >>> in Python.

Re: Instance variables question

2018-04-16 Thread Chris Angelico
On Tue, Apr 17, 2018 at 3:34 AM, Peter Otten <__pete...@web.de> wrote: > Irv Kalb wrote: > >> I have been writing OOP code for many years in other languages and for the >> past few years in Python. I am writing new curriculum for a course on OOP >> in Python. In order to see how others are explai

Re: Instance variables question

2018-04-16 Thread Irv Kalb
> On Apr 16, 2018, at 9:48 AM, duncan smith wrote: > > On 16/04/18 17:03, Irv Kalb wrote: >> I have been writing OOP code for many years in other languages and for the >> past few years in Python. I am writing new curriculum for a course on OOP >> in Python. In order to see how others are ex

Re: Instance variables question

2018-04-16 Thread Peter Otten
Irv Kalb wrote: > I have been writing OOP code for many years in other languages and for the > past few years in Python. I am writing new curriculum for a course on OOP > in Python. In order to see how others are explaining OOP concepts, I have > been reading as many books and watching as many v

Re: Instance variables question

2018-04-16 Thread duncan smith
On 16/04/18 17:03, Irv Kalb wrote: > I have been writing OOP code for many years in other languages and for the > past few years in Python. I am writing new curriculum for a course on OOP in > Python. In order to see how others are explaining OOP concepts, I have been > reading as many books a

Re: Instance variables question

2018-04-16 Thread Thomas Jollans
On 2018-04-16 18:03, Irv Kalb wrote: > He gives a demonstration using the following example: > > class PartyAnimal(): > x = 0 > > def party(self): > self.x = self.x + 1 > print('So far', self.x) > > [snip] > > But there is something there that seems odd. My understandin

Re: Instance variables question

2018-04-16 Thread Joseph L. Casale
From: Python-list on behalf of Irv Kalb Sent: Monday, April 16, 2018 10:03 AM To: python-list@python.org Subject: Instance variables question   > class PartyAnimal(): >     x = 0 > >     def party(self): >     self.x = self.x + 1 >     print('So far', sel

Instance variables question

2018-04-16 Thread Irv Kalb
I have been writing OOP code for many years in other languages and for the past few years in Python. I am writing new curriculum for a course on OOP in Python. In order to see how others are explaining OOP concepts, I have been reading as many books and watching as many videos as I can. I've