> 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
> -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'
> 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
> -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
>
> > >>> 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
> -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
> 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
> 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
> -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
> 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
> 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
11 matches
Mail list logo