Re: [Edu-sig] Uniform Access Principle confusion

2005-10-14 Thread Kirby Urner
> Perhaps stated in my usual inappropriately pithy manner. > > Art > Not too pythy, as we both know 'bout Python. Kirby ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig

Re: [Edu-sig] Uniform Access Principle confusion

2005-10-14 Thread Arthur
> -Original Message- > From: Kirby Urner [mailto:[EMAIL PROTECTED] > Sent: Friday, October 14, 2005 12:47 AM > To: 'Arthur'; edu-sig@python.org > Subject: RE: [Edu-sig] Uniform Access Principle confusion > > > Its simple and obvious - once it'

Re: [Edu-sig] Uniform Access Principle confusion

2005-10-13 Thread Kirby Urner
> Its simple and obvious - once it's simple and obvious. > > Downsides, warnings? > > Art > So far we're looking at pretty straightforward composition of objects (less an inheritance pattern), i.e. angle objects composed in a triangle. However, it could easily needlessly complexify, the ban

Re: [Edu-sig] Uniform Access Principle confusion

2005-10-13 Thread Arthur
> -Original Message- > From: Kirby Urner [mailto:[EMAIL PROTECTED] > > >>> class Angle (object): > > def __init__(self, thevalue): > self.value = float(thevalue) > > @property > def degrees(self): > return self.value > > @property >

Re: [Edu-sig] Uniform Access Principle confusion

2005-10-13 Thread Kirby Urner
> > >>> mytri = Triangle() > > >>> mytri.C.degrees > > 90 > > >>> mytri.C.radians > > 1.5707963267948966 > > Well that looks simple, elegant, and straightforward enough for my > purposes. > > > Is there a simple elegant and straightforward way to implement this API in > Python that I am mis

Re: [Edu-sig] Uniform Access Principle confusion

2005-10-13 Thread Arthur
> -Original Message- > From: Kirby Urner [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 13, 2005 7:35 PM > To: 'Arthur'; edu-sig@python.org > Subject: RE: [Edu-sig] Uniform Access Principle confusion > > > >>> mytri = Triangle() > &g

Re: [Edu-sig] Uniform Access Principle confusion

2005-10-13 Thread Kirby Urner
> model. The model itself contains to views. That should have been: "The model itself contains NO views." I was doing MVC earlier a bit on this list: http://mail.python.org/pipermail/edu-sig/2005-August/005087.html To see where our discussion of the Triangle class begins check: http://mail.pyt

Re: [Edu-sig] Uniform Access Principle confusion

2005-10-13 Thread Kirby Urner
> But in my (perhaps overly strict) way of OO thinking the unit of measure > is an attribute of the angle, not of the Triangle. > I think of the unit of measure more as an attribute of the viewer, so if this were MVC-style OO, we'd probably keep the model in some internal unit, perhaps integer, w

Re: [Edu-sig] Uniform Access Principle confusion

2005-10-13 Thread Arthur
> -Original Message- > From: Kirby Urner [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 12, 2005 2:25 PM > To: 'Arthur'; edu-sig@python.org > Subject: RE: [Edu-sig] Uniform Access Principle confusion > > > Note that passing an argument is not th

Re: [Edu-sig] Uniform Access Principle confusion

2005-10-12 Thread Kirby Urner
> In the case of Kirby's Triangle angle, might it be wise to avoid the > possibility of exploding any spacecraft, and insist that a contract be > formed with the caller so that the caller must specify whether they are > expecting the return value in radians or degrees? Seems maybe yes. But > that

[Edu-sig] Uniform Access Principle confusion

2005-10-12 Thread Arthur
> Behalf Of Arthur > > But I am certainly convinced that the freedom to make mistakes is > unassailable as part of a learning process. And therefore conclude that > programming in the style that Python allows is an unassailable and > under-utilized educational resource. Clarifying what I mean her