[Python-3000] Special methods and interface-based type system

George Sakkis gsakkis at rutgers.edu
Thu Nov 23 11:38:53 CET 2006


On 11/23/06, Talin <talin at acm.org> wrote:

> Fredrik Lundh wrote:
> > George Sakkis wrote:
> >
> >> First off, I never implied someone's stupid just because we don't
> >> happen to agree on everything.
> >
> > brushing off a carefully thought out design and the process that led
> > up to it with "it's just like picking between two random colors" is a
> > pretty direct way of saying that you consider yourself so much smarter
> > than the people involved that you don't even care about what they're doing.
>
> That's not what he said though. If you go back and read his original
> posting, he was commenting on the quality of *most arguments* about HCI,
> not HCI itself, or all HCI-related discussions.
>
> While I wouldn't say it quite so strongly, I do think that there is a
> great deal of subjectivity in HCI discussions. One person's 'intuitive'
> may be another person's 'orange smoke', as we've seen in the current
> discussion.
>
> I'm not saying that such discussion don't have merit, but we must be
> careful not to take our own sense of 'obviousness' too seriously. And
> that's what I think George was trying to say.

Exactly. My point was not against HCI in general, or Python's in
specific; most probably it wouldn't be my primary language for the
last three years if it didn't "feel right" in so many ways. What I'm
saying is that I can't claim it *is* right because it *feels* right to
*me*.

And to come back to len(), many people value uniformity and
consistency in a language. While I am not an absolute purist, I don't
see the gain in practicality and/or elegance of having len() a
function instead of method to justify the special case (at least in
today's python; generic functions may change this). Guido's point
about the generality of the operation (keys() applies to mappings,
len() and iter() apply to containers) raises the question of where to
set the "generality threshold" between functions and methods. Is it
absolutely wrong to set it higher than the container level (e.g. at
the object level) or lower (e.g. at sequence or mapping) ? I don't
think it's either wrong or right; it's subjective. That's all I am
saying.

George


More information about the Python-3000 mailing list