Skip to content

Commit 7339771

Browse files
committed
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 <sudo-ai-git@users.noreply.github.com>
1 parent 89343fd commit 7339771

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

maths/matrix_exponentiation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
https://www.hackerearth.com/practice/notes/matrix-exponentiation-1/
66
"""
77

8+
from __future__ import annotations
9+
810
import timeit
911

1012

0 commit comments

Comments
 (0)