An oddity in list comparison and element assignment
Alex Martelli
aleax at mac.com
Thu Jun 1 22:16:15 EDT 2006
<michael.f.ellis at gmail.com> wrote:
...
> I agree with Alex that checking for this type of inequality is not a
> trivial programming exercise. It requires (at least) a parallel
I'm not asking for ANY programming: I'm asking for a *straightforward
operational definition*. If the concept which you hanker after is NOT
subject to a straightforward operational definition, then I would rule
out that said concept could POSSIBLY be "natural".
> Alternatively, it might make sense to disallow == for containers by
> raising a TypeError although that would eliminate a largely useful
> feature.
This may be the best example I've ever seen of Emerson's well-known
quote about foolish consistency -- except that I don't think this
behavior would be "consistent" (either wisely or foolishly) with
anything except a vague handwaving set of constraints whose
"naturalness" (assuming it's unfeasible to provide a good and
straightforward operational definition) is out of the question.
Alex
More information about the Python-list
mailing list