Hello,
I was going through how ProductSet is implemented and couple of things
struck me as odd. First, the string/repr representation:
>>> s = FiniteSet(1, 2)
>>> t = FiniteSet(2, 3)
>>> p = ProductSet(s, t)
>>> p
{1, 2} x {2, 3}
IMO, a product set is a set (at least Wikipedia tells me so). So,
shouldn't it rather be the following?
{(1,2), (1,3), (2,2), (2,3)}
Again going by the same idea, I also feel, the len() function should
return the cardinatlity and not raise a TypeError:
>>> len(p)
Traceback (most recent call last):
File "<pyshell#166>", line 1, in <module>
len(p)
TypeError: object of type 'ProductSet' has no len()
Best,
Amit.
--
http://echorand.me