Skip to content

Commit 804d2af

Browse files
committed
Make mypy happy
1 parent 2124e81 commit 804d2af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mathics/core/atoms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def to_mpmath(self, precision: Optional[int] = None) -> mpmath.ctx_mp_python.mpf
132132
return mpmath.mpf(self.value)
133133
return mpmath.mpf(self.value)
134134

135-
def to_python(self, *_, **kwargs):
135+
def to_python(self, *_, **kwargs) -> Union[int, float, complex]:
136136
"""Returns a native builtin Python object
137137
something in (int, float, complex, str, tuple, list or dict.).
138138
(See discussions in
@@ -838,7 +838,7 @@ def to_python(self, *args, **kwargs) -> Union[int, float, complex]:
838838
Returns a Python equivalent value for this complex number.
839839
"""
840840
if self.imag.sameQ(Integer0):
841-
return self.real
841+
return self.real.to_python(*args, **kwargs)
842842

843843
return complex(
844844
self.real.to_python(*args, **kwargs), self.imag.to_python(*args, **kwargs)

0 commit comments

Comments
 (0)