diff --git a/gen_wrap.py b/gen_wrap.py
index 4c02c19d15ff2babb07b9bcf3910fdd74c324b8f..97bf6d4a94e8d5859959439d6e893edb4a3251fa 100644
--- a/gen_wrap.py
+++ b/gen_wrap.py
@@ -131,6 +131,8 @@ class Method:
 
 
 CLASSES = [
+        # /!\ Order matters, class names that are prefixes of others should go last.
+
         "options",
         "ctx",
 
@@ -165,7 +167,7 @@ CLASSES = [
         "qpolynomial", "pw_qpolynomial",
         "term",
 
-        "band", "schedule", "schedule_constraints",
+        "band", "schedule_constraints", "schedule",
         "schedule_node",
 
         "access_info", "flow", "restriction",