[Types-sig] RFC 0.1

Greg Stein gstein@lyra.org
Wed, 15 Dec 1999 03:09:46 -0800 (PST)


Woo hoo! Tim to the rescue! :-)

On Wed, 15 Dec 1999, Tim Peters wrote:
> [Greg Stein]
... me saying that it is nice for names to have different types...
> 
> [Guido]
... Guido saying that "feature" is less readable ...
> 
> It's an excellent example, but to me the *first* is easier to follow!  In
> the 2nd I'm left wondering what further use will be made of w, so have to
> try to keep w *and* s alive in my short-term memory.  In the 1st, I can
> scrub my brain cleaner harder oftener.

Yup. I might use two variables myself in that example, but using a single
name can definitely be easier in some cases...

> Heck, I wrote this just last week -- and deliberately:
... Tim's example code ...
> At the start of its life, the result is a (conceptual) set, and at the end
> it's a list with the same stuff.  That's not confusing -- it's helpful!  It
> wouldn't confuse a decent type-inference engine, either ("result" is a dict
> until the block starting with the .keys() call, and is a list thereafter;
> it's not even a "union type" -- at any given point, it's always one or the
> other).

Ha! I posted something just like this just the other day:
  http://www.python.org/pipermail/types-sig/1999-December/000518.html

Basically: I *totally* agree, and this is primarily the time when I use a
single variable name for two different types. This is also a reason why
I'd like to avoid the notion of associating a type with a [variable] name.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/