From 4dc0725171a35e782f4787c12b5dddbd1b728905 Mon Sep 17 00:00:00 2001 From: yap Date: Sun, 23 Aug 2026 16:50:17 +0800 Subject: [PATCH] fix: add future annotations to fix NameError in matrix_exponentiation.py Matrix.__mul__ references the Matrix class in its own annotation, which is evaluated while the class is still being defined. This makes importing the module raise NameError. Adding 'from __future__ import annotations' defers annotation evaluation, matching the convention used elsewhere in the repository. Closes #15075 --- maths/matrix_exponentiation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/maths/matrix_exponentiation.py b/maths/matrix_exponentiation.py index 15b0c96e0f07..5d0ef8e8aa76 100644 --- a/maths/matrix_exponentiation.py +++ b/maths/matrix_exponentiation.py @@ -1,5 +1,7 @@ """Matrix Exponentiation""" +from __future__ import annotations + import timeit """