Why does 1**2**3**4**5 raise a MemoryError?
Roy Smith
roy at panix.com
Mon Apr 1 07:48:21 EDT 2013
In article <51590a2b$0$30000$c3e8da3$5496439d at news.astraweb.com>,
Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
> Concrete examples of transitive relations: greater than, equal to, less
> than and equal to.
Will Python 4 implement "less than and equal to"? :-)
[Warning: topic creep]
Well, they are transitive over certain domains. Or, perhaps, a better
way to say it is they are transitive according to their traditional
mathematical definitions. But, computer languages don't always follow
those.
I used to work with a guy who was originally a math major. He used to
always complain about things like:
s = "foo" + "bar"
because addition is supposed to be commutative.
But, yeah, I know what you're saying that "transitive" applies to
relations, not to operators.
Although, of course, in some languages, relations *are* operators.
There's that pesky math vs. programming language dichotomy again.
More information about the Python-list
mailing list