Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Unique Representation

Please explain why the following output is as so. How is it possible for id's not to match but the names to be equal?

sage: SP = SetPartitions(5) sage: a = SetPartitions(5).random_element() sage: a {{2, 3, 4, 5}, {1}} sage: a in SetPartitions(5) True sage: a in SP True sage: print id(SP); print id(SetPartitions(5)) 188090924 188091308 sage: SP == SetPartitions(5) True

Unique Representation

Please explain why the following output is as so. How is it possible for id's not to match but the names to be equal?

sage: SP = SetPartitions(5)
sage: a = SetPartitions(5).random_element()
sage: a
{{2, 3, 4, 5}, {1}}
sage: id(a)
190399916
sage: a in SetPartitions(5)
True
sage: a in SP
True
sage: print id(SP); print id(SetPartitions(5))
188090924
188091308
sage: SP == SetPartitions(5)
True

True