Attack a sacred Python Cow

Jordan jordanrastrick at gmail.com
Thu Jul 24 11:03:45 EDT 2008


> Then why do you write, let me quote:
>
> """
> (snip) coding __eq__ (snip) buys you
> nothing from the != operator. != isn't (by default) a synonym for the
> negation of == (unlike in, say, every other language ever); not only
> will Python let you make them mean different things, without
> documenting this fact - it actively encourages you to do so.
> """

My words aren't as clear as they should be. I mean that Python lets
*you* do something without documenting, or rather stating to use a
better term, that your intention is the non-obvious one. I'm not
saying that Python itself lacks documentation for its own behaviour;
I'm saying it should force you to make your intentions clear and
visible to someone reading your code when you want to do something non-
obvious.

> I was not commenting on the actual design choice, just stating that it
> is actually documented.

Yes, it is. I apologise for the poor construction of my statement
which led to this confusion.

> And you're talking about strawman ??? Come on, you obviously can tell
> the difference between a one-line statement and your above strawman
> argument, don't you ?

I'm talking about strawmen because I was deliberately choosing to
invoke one with rhetorical flourish for the purposes of making my
point forcefully. I wanted people to be clear that I knew perfectly
well what I was doing and that they needn't call me out on it.

> Please understand that I'm not arguing about this particular design
> choice (and FWIW, I'd mostly agree on the point that having a != b
> different from not (a == b) is actually a wart). I'm just correcting
> your statement about the behaviour of __eq__ / __ne__ not being
> documented, which is obviously false.

Good, at least we've come to a point in this discussion where I can
firmly agree with somebody.



More information about the Python-list mailing list