andyvand / gmpy

Automatically exported from code.google.com/p/gmpy
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Can't compare mpz to None #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
gmpy comparisons raise a TypeError when coercion fails.

>>> gmpy.mpz(1) == None
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: coercion to gmpy.mpz type failed

Another example:

>>> [gmpy.mpz(4), None].count(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: coercion to gmpy.mpz type failed

Original issue reported on code.google.com by casevh on 14 Oct 2008 at 5:20

GoogleCodeExporter commented 9 years ago
Fixed by Alex's patch to support rich_compare.

Original comment by casevh on 3 Jan 2009 at 11:42