Skip to content

Commit

Permalink
SageMath deprecation warnings: implement our own is_[...]IntervalFiel…
Browse files Browse the repository at this point in the history
…dElement using isinstance instead of using the deprecated methods from SageMath.
  • Loading branch information
unhyperbolic committed Dec 8, 2024
1 parent 6739a69 commit 6a64edd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions python/math_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ def is_Interval(x):

if _within_sage:
from sage.all import prod, xgcd
from sage.rings.real_mpfi import is_RealIntervalFieldElement
from sage.rings.complex_interval import is_ComplexIntervalFieldElement
from sage.rings.real_mpfi import RealIntervalFieldElement
from sage.rings.complex_interval import ComplexIntervalFieldElement

def is_RealIntervalFieldElement(x):
return isinstance(x, RealIntervalFieldElement)

def is_ComplexIntervalFieldElement(x):
return isinstance(x, ComplexIntervalFieldElement)

else:

Expand Down

0 comments on commit 6a64edd

Please sign in to comment.