sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.36k stars 462 forks source link

Do not convert unsigned elements to InfinityRing #17825

Open dkrenn opened 9 years ago

dkrenn commented 9 years ago
sage: InfinityRing(x)
A negative finite number
sage: InfinityRing("junk")
A positive finite number

Component: coercion

Author: Jeroen Demeyer

Branch/Commit: u/jdemeyer/do_not_convert_unsigned_elements_to_infinityring @ 93a039f

Reviewer: Ralf Stephan

Issue created by migration from https://trac.sagemath.org/ticket/17825

jdemeyer commented 7 years ago

Description changed:

--- 
+++ 
@@ -1,9 +1,7 @@
-We have

sage: InfinityRing(x) A negative finite number -sage: InfinityRing(SR.var('q')) -A negative finite number +sage: InfinityRing("junk") +A positive finite number

-which looks weird.
jdemeyer commented 7 years ago

Author: Jeroen Demeyer

jdemeyer commented 7 years ago

Branch: u/jdemeyer/do_not_convert_unsigned_elements_to_infinityring

jdemeyer commented 7 years ago

Commit: e16686d

jdemeyer commented 7 years ago

New commits:

e16686dDo not convert unsigned elements to InfinityRing
rwst commented 6 years ago
comment:4

Does not apply.

jdemeyer commented 6 years ago
comment:5

Do you plan to review this ticket if I fix the conflict?

rwst commented 6 years ago
comment:6

Yes. I have asked others this question in the past. Perhaps some people use the code but don't want to review it...

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

93a039fDo not convert unsigned elements to InfinityRing
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Changed commit from e16686d to 93a039f

rwst commented 6 years ago

Reviewer: Ralf Stephan

rwst commented 6 years ago
comment:9

The sardonis patchbot has one relevant doctest fail. It appears that to determine RIF(-1,1) < oo it has to be coerced to the infinity ring but it has no sign. OTOH, RIF(-1,1) < oo is perfectly easily solvable so should not give an error.

jdemeyer commented 6 years ago
comment:10

Replying to @rwst:

OTOH, RIF(-1,1) < oo is perfectly easily solvable so should not give an error.

That doesn't really matter. The coercion model always coerces. And it is the coercion which fails in this case. That is not easy to fix.