Opened 11 years ago

Closed 10 years ago

# Sympy minus infinity doesn't convert to Sage

Reported by: Owned by: kcrisman burcin major sage-5.1 symbolics sd40.5 certik, rws sage-5.1.beta4 Douglas McNeil Karl-Dieter Crisman N/A u/akhi/sympy_minus_infinity_doesn_t_convert_to_sage 52db42b01c1b86c752652a09533e50dd0d899ab3

### Description

```sage: a,b = oo, -oo
sage: a._sympy_()
oo
sage: b._sympy_()
--------------------------------------------
AttributeError                            Traceback (most recent call last)

/Users/.../sage-4.7.2/local/lib/python2.6/site-packages/sage/structure/element.so in sage.structure.element.Element.__getattr__ (sage/structure/element.c:2840)()

AttributeError: 'MinusInfinity' object has no attribute '_sympy_'
```

See this ask.sagemath.org question for background.

### comment:1 Changed 10 years ago by dsm

• Status changed from new to needs_review

Straightforward fix and test of the original case as an integral.

### comment:2 Changed 10 years ago by kcrisman

• Authors set to Douglas McNeil
• Reviewers set to Karl-Dieter Crisman

Umm, even without this patch I get

```sage: import sympy
sage: bool(SR(-oo) == -sympy.oo)
True
sage: bool(-oo == -sympy.oo)
True
```

Am I missing something? How is that an indirect doctest?

That said, the integral works fine now and the tests pass.

### comment:3 Changed 10 years ago by dsm

Ah, those were merely mirroring the +oo cases. Really they were only testing whether the negation worked; it was the integral test which was really verifying the success. However, we can test it explicitly by adding.

```    sage: bool((-oo)._sympy_() == -sympy.oo)
True
```

which fails without the patch. Modified to incorporate this.

### comment:4 Changed 10 years ago by kcrisman

• Status changed from needs_review to positive_review

Positive review.

### comment:5 Changed 10 years ago by jdemeyer

• Merged in set to sage-5.1.beta4
• Resolution set to fixed
• Status changed from positive_review to closed

### comment:6 Changed 7 years ago by akhi

• Branch set to u/akhi/sympy_minus_infinity_doesn_t_convert_to_sage