id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
13378 Do not cache the non-existence of coerce/convert map too often, and do not pretend that there is a conversion where it doesn't make sense at all SimonKing robertwb "Sorry for the long ticket title.
About the first part of the title:
{{{
sage: P. = QQ[]
sage: P.is_coercion_cached(x)
False
sage: P.coerce_map_from(x)
sage: P.is_coercion_cached(x)
True
}}}
Hence, there is a reference to x in the coercion cache for P. OK, by #715 and friends, the reference is weak --- unless x does not allow weak references, in which case the reference will be strong, and x would not be collectable. Hence, a potential memory leak.
About the second part:
{{{
sage: ZZ.convert_map_from(1)
Conversion map:
From: Set of Python objects of
To: Integer Ring
}}}
or
{{{
sage: P.convert_map_from(x)
Traceback (most recent call last):
...
TypeError: Cannot convert sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular to sage.structure.parent.Parent
}}}
I think it is not good that the error occurs. The answer of `ZZ.convert_map_from(1)` seems strange, but apparently those things actually occur, namely conversions from the category of sequences." defect closed major sage-5.7 coercion fixed coercion conversion object cache nbruin jpflori sage-5.7.beta0 Simon King Nils Bruin N/A