I want to add elements of the fraction field of QQ[x,y] to a set, i.e., make sure there are no repeats. However, set.add()ing an element that is equal to a previous element sometimes puts another copy of the element in. Witness the following behavior:
> R = PolynomialRing(QQ,'x,y') > K = R.fraction_field() > x,y = gens(K) > (2*x)/(2*y) == x/y True > x/y in set([(2*x)/(2*y)]) False > x/y in [(2*x)/(2*y)] True Why should these last two behaviors differ? And how do I get the second behavior out of a set without converting to a list and back? For example, is there some way to force elements of K into a canonical form? Thanks, Josh WinXP/VMware Player SAGE Version 2.10.3, Release Date: 2008-03-11 Acquired via binary build --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
