Commits

Carl Friedrich Bolz  committed 345ef57

make the standardizer immutable

  • Participants
  • Parent commits ab7d175
  • Branches compress-terms2

Comments (0)

Files changed (1)

File prolog/interpreter/shape.py

 def make_standardizer(w_obj):
     memo = []
     shape = term_with_numbered_vars_to_shape(w_obj, memo)
-    return Standardizer(shape, memo)
+    return Standardizer(shape, memo[:])
 
 def term_with_numbered_vars_to_shape(w_obj, memo):
     from prolog.interpreter import term
     return WrapShape(w_obj)
 
 class Standardizer(object):
+    _immutable_fields_ = ["shape", "memo[*]"]
     def __init__(self, shape, memo):
         self.shape = shape
         self.memo = memo