Commits

Ali Gholami Rudi  committed 4159480

pyobjectsdef: using _ScopeVisitor methods in _ClassVisitor

  • Participants
  • Parent commits 29a4496

Comments (0)

Files changed (1)

File rope/base/pyobjectsdef.py

         super(_ClassVisitor, self).__init__(pycore, owner_object)
 
     def _FunctionDef(self, node):
-        pyfunction = PyFunction(self.pycore, node, self.owner_object)
-        self.names[node.name] = pynames.DefinedName(pyfunction)
-        self.defineds.append(pyfunction)
+        _ScopeVisitor._FunctionDef(self, node)
         if len(node.args.args) > 0:
             first = node.args.args[0]
             if isinstance(first, ast.Name):
                 for child in ast.get_child_nodes(node):
                     ast.walk(child, new_visitor)
 
-    def _ClassDef(self, node):
-        pyclass = PyClass(self.pycore, node, self.owner_object)
-        self.names[node.name] = pynames.DefinedName(pyclass)
-        self.defineds.append(pyclass)
-
 
 class _FunctionVisitor(_ScopeVisitor):