Skip to content

Commit 883830f

Browse files
committed
More lint-like things
1 parent effd9e7 commit 883830f

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

mathics/builtin/arithmetic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import sympy
1313
import mpmath
14-
import math
1514

1615
from mathics.builtin.base import (
1716
Builtin,
@@ -1350,7 +1349,7 @@ def apply(self, expr, evaluation):
13501349
# try expanding the expression
13511350
exprexp = Expression("ExpandAll", expr).evaluate(evaluation)
13521351
exprexp = exprexp.to_sympy()
1353-
result = _iszero(exprexp)
1352+
result = _iszero(exprexp)
13541353
if result is None:
13551354
# Can't get exact answer, so try approximate equal
13561355
numeric_val = Expression("N", expr).evaluate(evaluation)

mathics/builtin/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

4-
import mpmath
54
import re
65
import sympy
76

87
from functools import total_ordering
98
import importlib
109
from itertools import chain
11-
1210
import typing
1311
from typing import Any, cast
1412

@@ -411,9 +409,11 @@ class Operator(Builtin):
411409
def get_operator(self) -> typing.Optional[str]:
412410
return self.operator
413411

414-
def get_operator_display(self) -> typing.Optional[str]:
412+
def get_operator_display(self, want_unicode=False) -> typing.Optional[str]:
415413
if hasattr(self, "operator_display"):
416414
return self.operator_display
415+
elif want_unicode:
416+
return self.operator
417417
else:
418418
return self.operator
419419

@@ -533,7 +533,7 @@ def apply(self, expr, evaluation) -> Symbol:
533533

534534

535535
class SympyFunction(SympyObject):
536-
def get_constant(self, precision, have_mpmath=False):
536+
def get_constant(self, precision, evaluation, have_mpmath=False):
537537
try:
538538
d = get_precision(precision, evaluation)
539539
except PrecisionValueError:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import sys
2626
import os.path as osp
2727
import platform
28-
from setuptools import setup, Command, Extension
28+
from setuptools import setup, Extension
2929

3030
# Ensure user has the correct Python version
3131
if sys.version_info < (3, 6):

0 commit comments

Comments
 (0)