1. Ali Gholami Rudi
  2. rope_py3k


Ali Gholami Rudi  committed b581f8f

pyscopes: using utils.cacheit for Scope.get_scope()

  • Participants
  • Parent commits 3d37755
  • Branches trunk

Comments (0)

Files changed (1)

File rope/base/pyscopes.py

View file
         self.pycore = pycore
         self.pyobject = pyobject
         self.parent = parent_scope
-        self.scopes = None
     def get_names(self):
         """Return the names defined or imported in this scope"""
         """The same as ``key in self.get_names()``"""
         return key in self.get_names()
+    @utils.cacheit
     def get_scopes(self):
         """Return the subscopes of this scope
         The returned scopes should be sorted by the order they appear.
-        if self.scopes is None:
-            self.scopes = self._create_scopes()
-        return self.scopes
+        return self._create_scopes()
     def lookup(self, name):
         if name in self.get_names():