[Types-sig] Re: expression-based type assertions
Greg Stein
gstein@lyra.org
Wed, 15 Dec 1999 02:47:24 -0800 (PST)
On Tue, 14 Dec 1999, Paul Prescod wrote:
> Greg Stein wrote:
> >
> > ...
> > In fact, I would even say that the only type declarations used would be
> > associated with function params and returns (and not variable).
>
> How do we handle attribute values? We can't just say "interfaces" unless
> we agree that interfaces allow type declarations to be associated with
> instance variables. And if we start associating type declarations with
> attribute names as we do parameter names, why wouldn't we also allow
> that for local and global variables?
This was covered elsewhere, but for completeness...
We handle attribute values thru interfaces, which associate typedecls with
attributes. (and yes, an instance variable is an attribute)
I do not see a logical extension of that framework that states you should
also provide typedecls for variables (local/global). Specifying the type
of an attribute is a very different matter from specifying the type of a
global. As I've stated: I think specifying the type of a local/global is
needless syntactic sugar, which Python (thankfully) has a minimum of.
Note that modules and classes each have an interface (to establish type
info).
Cheers,
-g
--
Greg Stein, http://www.lyra.org/