Ticket #1210 (new defect)

Opened 1 year ago

Cannot create distinct polynomial rings over p-adic rings with different print_modes

Reported by: ncalexan Assigned to: roed
Priority: major Milestone: sage-3.4
Component: commutative algebra Keywords: polynomial p-adic print mode cache caching
Cc:

Description

The issue is in the caching:

sage: R = Qp(7, print_mode='val-unit')
sage: S = Qp(7)
sage: R(7^2 + 1)
7^2 * 1 + O(7^22)
sage: S(7^2)
7^2 + O(7^22)
sage: R(7^2 + 1)
50 + O(7^20)
sage: S(7^2 + 1)
1 + 7^2 + O(7^20)
sage: R is S
False
sage: R['x'] is S['x']
True

The issue manifests itself in polynomial_ring_constructor, which fails because the cache is keyed by ==, not identity, and

sage: R == S
True