]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/eja/eja_utils.py: replace deprecated is_Matrix()
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 22 Nov 2024 18:53:10 +0000 (13:53 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 22 Nov 2024 18:53:10 +0000 (13:53 -0500)
mjo/eja/eja_utils.py

index a8abeff6be073b2b0aea3dd4f5af933c251666a5..a497044a65ad214b573f1a8acc5c31dd9d960457 100644 (file)
@@ -1,5 +1,3 @@
-from sage.structure.element import is_Matrix
-
 def _scale(x, alpha):
     r"""
     Scale the vector, matrix, or cartesian-product-of-those-things
@@ -113,7 +111,8 @@ def _all2list(x):
         # because vectors can only contain ring elements as entries.
         return x.to_vector().list()
 
-    if is_Matrix(x):
+    from sage.structure.element import Matrix
+    if isinstance(x, Matrix):
         # This sucks, but for performance reasons we don't want to
         # call _all2list recursively on the contents of a matrix
         # when we don't have to (they only contain ring elements