Re: [Tutor] Does composition only work with particular instances of objects?

2015-08-14 Thread Alan Gauld
On 14/08/15 05:31, boB Stepp wrote: I was looking at an example illustrating composition from the book, Introducing Python by Bill Lubanovic on p. 140: class Bill: def __init__(self, description): self.description = description class Tail: def __init__(self,

Re: [Tutor] Does composition only work with particular instances of objects?

2015-08-14 Thread boB Stepp
On Fri, Aug 14, 2015 at 2:50 AM, Alan Gauld alan.ga...@btinternet.com wrote: So, unless the book explains why this is bad practice and goes on to show a good example, I must conclude its a very bad example. I found the errata pages for the book

[Tutor] Does composition only work with particular instances of objects?

2015-08-13 Thread boB Stepp
I was looking at an example illustrating composition from the book, Introducing Python by Bill Lubanovic on p. 140: class Bill: def __init__(self, description): self.description = description class Tail: def __init__(self, length): self.length = length

Re: [Tutor] Does composition only work with particular instances of objects?

2015-08-13 Thread Zachary Ware
On Thu, Aug 13, 2015 at 11:31 PM, boB Stepp robertvst...@gmail.com wrote: I was looking at an example illustrating composition from the book, Introducing Python by Bill Lubanovic on p. 140: class Bill: def __init__(self, description): self.description = description

Re: [Tutor] Does composition only work with particular instances of objects?

2015-08-13 Thread boB Stepp
On Thu, Aug 13, 2015 at 11:46 PM, Zachary Ware zachary.ware+py...@gmail.com wrote: On Thu, Aug 13, 2015 at 11:31 PM, boB Stepp robertvst...@gmail.com wrote: I was looking at an example illustrating composition from the book, Introducing Python by Bill Lubanovic on p. 140: class Bill: