Skip to content

Commit 702bcea

Browse files
Merge pull request sympy#20197 from sidhu1012/pyup
drop python 2 from entire sympy
2 parents 48ec7d5 + 4a2167f commit 702bcea

File tree

214 files changed

+665
-994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+665
-994
lines changed

sympy/abc.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151
5252
"""
5353

54-
from __future__ import print_function, division
55-
5654
from typing import Any, Dict
5755

5856
import string

sympy/conftest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function, division
2-
31
import sys
42
sys._running_pytest = True # type: ignore
53
from distutils.version import LooseVersion as V

sympy/core/symbol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ def numbered_string_incr(s, start=0):
169169
return _symbol(x, default, **assumptions)
170170
if not is_sequence(exprs):
171171
exprs = [exprs]
172-
names = set().union((
172+
names = set().union(
173173
[i.name for e in exprs for i in e.atoms(Symbol)] +
174-
[i.func.name for e in exprs for i in e.atoms(AppliedUndef)]))
174+
[i.func.name for e in exprs for i in e.atoms(AppliedUndef)])
175175
if modify is None:
176176
modify = numbered_string_incr
177177
while any(x == compare(s) for s in names):

sympy/core/tests/test_args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_all_classes_are_tested():
3434
if not file.endswith(".py"):
3535
continue
3636

37-
with open(os.path.join(root, file), "r", encoding='utf-8') as f:
37+
with open(os.path.join(root, file), encoding='utf-8') as f:
3838
text = f.read()
3939

4040
submodule = module + '.' + file[:-3]

sympy/diffgeom/diffgeom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,7 @@ def metric_to_Ricci_components(expr):
20382038
# Classes for deprecation
20392039
###############################################################################
20402040

2041-
class _deprecated_container(object):
2041+
class _deprecated_container:
20422042
# This class gives deprecation warning.
20432043
# When deprecated features are completely deleted, this should be removed as well.
20442044
# See https://github.com/sympy/sympy/pull/19368

sympy/functions/elementary/integers.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
from __future__ import print_function, division
3-
41
from sympy import Basic, Expr
52

63
from sympy.core import Add, S

sympy/interactive/tests/test_interactive.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from sympy.interactive.session import int_to_Integer
32

43

sympy/matrices/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,11 +1286,11 @@ def _eval_values(self):
12861286

12871287
def _has_positive_diagonals(self):
12881288
diagonal_entries = (self[i, i] for i in range(self.rows))
1289-
return fuzzy_and((x.is_positive for x in diagonal_entries))
1289+
return fuzzy_and(x.is_positive for x in diagonal_entries)
12901290

12911291
def _has_nonnegative_diagonals(self):
12921292
diagonal_entries = (self[i, i] for i in range(self.rows))
1293-
return fuzzy_and((x.is_nonnegative for x in diagonal_entries))
1293+
return fuzzy_and(x.is_nonnegative for x in diagonal_entries)
12941294

12951295
def atoms(self, *types):
12961296
"""Returns the atoms that form the current object.
@@ -1518,7 +1518,7 @@ def test_row(i):
15181518
summation += Abs(self[i, j])
15191519
return (Abs(self[i, i]) - summation).is_nonnegative
15201520

1521-
return fuzzy_and((test_row(i) for i in range(rows)))
1521+
return fuzzy_and(test_row(i) for i in range(rows))
15221522

15231523
@property
15241524
def is_strongly_diagonally_dominant(self):
@@ -1568,7 +1568,7 @@ def test_row(i):
15681568
summation += Abs(self[i, j])
15691569
return (Abs(self[i, i]) - summation).is_positive
15701570

1571-
return fuzzy_and((test_row(i) for i in range(rows)))
1571+
return fuzzy_and(test_row(i) for i in range(rows))
15721572

15731573
@property
15741574
def is_hermitian(self):

sympy/matrices/expressions/matexpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def _eval_derivative(self, x):
214214
# `x` is a scalar:
215215
if self.has(x):
216216
# See if there are other methods using it:
217-
return super(MatrixExpr, self)._eval_derivative(x)
217+
return super()._eval_derivative(x)
218218
else:
219219
return ZeroMatrix(*self.shape)
220220

sympy/matrices/expressions/tests/test_blockmatrix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ def test_BlockMatrix_2x2_inverse_symbolic():
188188
C = ZeroMatrix(m, m)
189189
D = MatrixSymbol('D', m, n)
190190
X = BlockMatrix([[A, B], [C, D]])
191-
assert block_collapse(X.inverse()) == BlockMatrix(([
191+
assert block_collapse(X.inverse()) == BlockMatrix([
192192
[-(C - D * B.I * A).I * D * B.I, (C - D * B.I * A).I],
193193
[B.I + B.I * A * (C - D * B.I * A).I * D * B.I, -B.I * A * (C - D * B.I * A).I],
194-
]))
194+
])
195195

196196
# test code path where only C is invertible
197197
A = MatrixSymbol('A', n, m)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy