Re: [Tutor] Why begin a function name with an underscore

2012-08-28 Thread Jerry Zhang
2012/8/28 Richard D. Moores > On Mon, Aug 27, 2012 at 6:33 PM, Japhy Bartlett > wrote: > > > something like: > > > > def _validate_int(obj): > > """Raise an exception if obj is not an integer.""" > > m = int(obj + 0) # May raise TypeError. > > if obj != m: > > raise ValueErr

Re: [Tutor] The python implementation of the "class relationship".

2011-11-10 Thread Jerry Zhang
2011/11/11 Alan Gauld > On 10/11/11 09:23, Jerry Zhang wrote: > >> As you know, there are several kinds of relationships between classes in >> the UML -- dependency, association, aggregation, composition. >> > > There are several more besides, but lets not get car

Re: [Tutor] The python implementation of the "class relationship".

2011-11-10 Thread Jerry Zhang
Thanks for your reply. 2011/11/10 Steven D'Aprano > Jerry Zhang wrote: > >> As you know, there are several kinds of relationships between classes in >> the UML -- dependency, association, aggregation, composition. >> > > "As you know"... no, I&#x

[Tutor] The python implementation of the "class relationship".

2011-11-10 Thread Jerry Zhang
As you know, there are several kinds of relationships between classes in the UML -- dependency, association, aggregation, composition. Q1. Is there any article or code example on its implementation in python? Q2. More specific, in composition model, the container object may be responsible for the h