From 7339771e16b23baaaf7f7f9f3fd4da1fc578474d Mon Sep 17 00:00:00 2001 From: sudo-ai-git Date: Thu, 10 Sep 2026 00:35:02 -0500 Subject: [PATCH] fix(maths): defer Matrix type annotations so import does not NameError Importing maths.matrix_exponentiation raised 'NameError: name Matrix is not defined' because __mul__ and modular_exponentiation annotate with Matrix before the class name is bound (annotations evaluate eagerly at class-body execution time). Add 'from __future__ import annotations' to defer annotation evaluation, matching the pattern used elsewhere in the repo. Verified on current master: import succeeds (NameError gone) and all 10 doctests pass. Signed-off-by: sudo-ai-git --- maths/matrix_exponentiation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/maths/matrix_exponentiation.py b/maths/matrix_exponentiation.py index bb88e52f3f38..453a4763accc 100644 --- a/maths/matrix_exponentiation.py +++ b/maths/matrix_exponentiation.py @@ -5,6 +5,8 @@ https://www.hackerearth.com/practice/notes/matrix-exponentiation-1/ """ +from __future__ import annotations + import timeit