Skip to content

Commit 53d5662

Browse files
committed
removing some unused imports in pyx files
1 parent 7ef5433 commit 53d5662

File tree

9 files changed

+11
-20
lines changed

9 files changed

+11
-20
lines changed

Diff for: src/sage/categories/category_singleton.pyx

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ Singleton categories
99
# Distributed under the terms of the GNU General Public License (GPL)
1010
# https://www.gnu.org/licenses/
1111
# *****************************************************************************
12+
from cpython.type cimport PyType_IsSubtype
1213

1314
from sage.misc.constant_function import ConstantFunction
1415
from sage.misc.lazy_attribute import lazy_class_attribute
1516
from sage.categories.category import Category
1617
from sage.structure.category_object cimport CategoryObject
1718
from sage.structure.dynamic_class import DynamicMetaclass
1819

19-
# I have no idea why this is necessary, but otherwise the type import fails (maybe because its shadowed by sage's cpython module?)
20-
from cpython.method cimport PyMethod_Check
21-
from cpython.type cimport PyType_IsSubtype
22-
2320
# This helper class is used to implement Category_singleton.__contains__
2421
# In particular, the docstring is what appears upon C.__contains__?
2522
# for C a singleton category like Fields().

Diff for: src/sage/coding/binary_code.pyx

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ AUTHOR:
3030
* canonical generation function
3131
"""
3232

33-
#*****************************************************************************
33+
# ***************************************************************************
3434
# Copyright (C) 2007 Robert L. Miller <[email protected]>
3535
#
3636
# This program is free software: you can redistribute it and/or modify
3737
# it under the terms of the GNU General Public License as published by
3838
# the Free Software Foundation, either version 2 of the License, or
3939
# (at your option) any later version.
40-
# http://www.gnu.org/licenses/
41-
#*****************************************************************************
40+
# https://www.gnu.org/licenses/
41+
# ***************************************************************************
4242

4343
from libc.string cimport memcpy
4444
from cpython.mem cimport *
4545
from cpython.object cimport PyObject_RichCompare
46-
from cysignals.memory cimport sig_malloc, sig_realloc, sig_free
46+
from cysignals.memory cimport sig_malloc, sig_free
4747

4848
from sage.structure.element cimport Matrix
4949
from sage.misc.timing import cputime

Diff for: src/sage/graphs/traversals.pyx

-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ Methods
6161

6262
from collections import deque
6363

64-
from libc.string cimport memset
6564
from libc.stdint cimport uint32_t
6665
from libcpp.vector cimport vector
6766
from cysignals.signals cimport sig_on, sig_off
@@ -73,7 +72,6 @@ from sage.graphs.base.static_sparse_backend cimport StaticSparseCGraph
7372
from sage.graphs.base.static_sparse_backend cimport StaticSparseBackend
7473
from sage.graphs.base.static_sparse_graph cimport init_short_digraph
7574
from sage.graphs.base.static_sparse_graph cimport free_short_digraph
76-
from sage.graphs.base.static_sparse_graph cimport out_degree
7775
from sage.graphs.graph_decompositions.slice_decomposition cimport \
7876
extended_lex_BFS
7977

Diff for: src/sage/libs/singular/ring.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ from sage.libs.singular.decl cimport rDefault, GFInfo, ZnmInfo, nInitChar, AlgEx
3333

3434
from sage.rings.integer cimport Integer
3535
from sage.rings.integer_ring cimport IntegerRing_class
36-
from sage.rings.integer_ring import ZZ
3736
import sage.rings.abc
3837
from sage.rings.number_field.number_field_base cimport NumberField
3938
from sage.rings.rational_field import RationalField

Diff for: src/sage/matrix/matrix_dense.pyx

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ TESTS::
1111
cimport sage.matrix.matrix as matrix
1212

1313
from sage.structure.richcmp cimport richcmp_item, rich_to_bool
14-
from sage.calculus.functional import derivative
1514
import sage.matrix.matrix_space
1615
import sage.structure.sequence
1716

@@ -211,7 +210,7 @@ cdef class Matrix_dense(matrix.Matrix):
211210
e2 = self.get_unsafe(nrows - i - 1, ncols - j - 1)
212211
self.set_unsafe(i, j, e2)
213212
self.set_unsafe(nrows - i - 1, ncols - j - 1, e1)
214-
if nrows % 2 == 1:
213+
if nrows % 2:
215214
i = nrows // 2
216215
for j in range(ncols // 2):
217216
e1 = self.get_unsafe(i, j)

Diff for: src/sage/matrix/matrix_sparse.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ from cysignals.signals cimport sig_check
1616
cimport sage.matrix.matrix as matrix
1717
cimport sage.matrix.matrix0 as matrix0
1818
from sage.categories.rings import Rings
19-
from sage.calculus.functional import derivative
2019
from sage.structure.element cimport Element, Vector
2120
from sage.structure.richcmp cimport richcmp_item, rich_to_bool
2221

Diff for: src/sage/matroids/transversal_matroid.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ REFERENCES:
4747
from collections import Counter
4848
from copy import copy
4949
from cpython.object cimport Py_EQ, Py_NE
50-
from sage.graphs.graph import Graph
50+
import networkx as nx
51+
5152
from sage.graphs.digraph import DiGraph
5253
from sage.graphs.bipartite_graph import BipartiteGraph
5354
from sage.matroids.basis_exchange_matroid cimport BasisExchangeMatroid
5455
from sage.matroids.minor_matroid import MinorMatroid
5556
from sage.matroids.utilities import newlabel
56-
import networkx as nx
5757

5858

5959
cdef class TransversalMatroid(BasisExchangeMatroid):

Diff for: src/sage/misc/fpickle.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ REFERENCE: The python cookbook.
77
"""
88
import copyreg
99
import pickle
10-
import sys
1110
import types
1211

1312

Diff for: src/sage/numerical/linear_tensor_element.pyx

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ from cpython.object cimport *
2323

2424
from sage.misc.fast_methods cimport hash_by_id
2525
from sage.structure.element cimport ModuleElement, Element
26-
from sage.numerical.linear_functions cimport LinearFunction, is_LinearFunction
26+
from sage.numerical.linear_functions cimport LinearFunction
2727

2828

29-
#*****************************************************************************
29+
# ***************************************************************************
3030
#
3131
# Elements of linear functions tensored with a free module
3232
#
33-
#*****************************************************************************
33+
# ***************************************************************************
3434

3535
cdef class LinearTensor(ModuleElement):
3636
r"""

0 commit comments

Comments
 (0)