Normalize WTK_declare_pyfunction -> declare_pyfunction.
authorW. Trevor King <wking@drexel.edu>
Fri, 4 Mar 2011 01:59:47 +0000 (20:59 -0500)
committerW. Trevor King <wking@drexel.edu>
Fri, 4 Mar 2011 01:59:47 +0000 (20:59 -0500)
Cython/Compiler/Nodes.py
Cython/Compiler/Symtab.py

index 188f787e10d2d108afdfe7e3bb9a437592f825b2..8e18658e334605a3aefd800781fdd22a000c442a 100644 (file)
@@ -2190,7 +2190,9 @@ class DefNode(FuncDefNode):
         entry = env.lookup_here(name)
         if entry and entry.type.is_cfunction and not self.is_wrapper:
             warning(self.pos, "Overriding cdef method with def method.", 5)
-        entry = env.declare_pyfunction(name, self.pos, allow_redefine=not self.is_wrapper)
+        binding = Binding(name = name)
+        entry = env.declare_pyfunction(
+            binding, allow_redefine=not self.is_wrapper, pos = self.pos)
         self.entry = entry
         prefix = env.next_id(env.scope_prefix)
 
index 4f71846f7c3ada2e61ef2ca7e92a43d6d312142f..16ec4938bffab2809daa80b6f0c2685b8d5f51c5 100644 (file)
@@ -610,12 +610,7 @@ class Scope(object):
         self.pyfunc_entries.append(entry)
         return entry
 
-    def declare_pyfunction(self, name, pos, allow_redefine=False, visibility='extern'):
-        binding = self._WTK_setup(name, None, visibility)
-        return self.WTK_declare_pyfunction(binding, allow_redefine, pos)
-
-    def WTK_declare_pyfunction(self, binding,
-                               allow_redefine = False, pos = None):
+    def declare_pyfunction(self, binding, allow_redefine = False, pos = None):
         # Add an entry for a Python function.
         entry = self.lookup_here(binding.name)
         if not allow_redefine or Options.disable_function_redefinition:
@@ -1591,13 +1586,8 @@ class ClosureScope(LocalScope):
 #        return "%s->%s" % (self.cur_scope_cname, name)
 #        return "%s->%s" % (self.closure_cname, name)
 
-    def declare_pyfunction(self, name, pos, allow_redefine=False):
-        binding = self._WTK_setup(name, name, visibility='private')
-        return self.WTK_declare_pyfunction(binding, allow_redefine, pos)
-
-    def WTK_declare_pyfunction(self, binding,
-                              allow_redefine=False, pos=None):
-        return LocalScope.WTK_declare_pyfunction(
+    def declare_pyfunction(self, binding, allow_redefine=False, pos=None):
+        return LocalScope.declare_pyfunction(
             self, binding, allow_redefine, pos)
 
 class StructOrUnionScope(Scope):
@@ -1801,12 +1791,7 @@ class CClassScope(ClassScope):
             self.namespace_cname = "(PyObject *)%s" % self.parent_type.typeptr_cname
             return entry
 
-    def declare_pyfunction(self, name, pos, allow_redefine=False):
-        binding = self._WTK_setup(name, name, 'extern')
-        return self.WTK_declare_pyfunction(binding, allow_redefine, pos)
-
-    def WTK_declare_pyfunction(self, binding,
-                              allow_redefine = False, pos = None):
+    def declare_pyfunction(self, binding, allow_redefine = False, pos = None):
         # Add an entry for a method.
         if binding.name in ('__eq__', '__ne__', '__lt__', '__gt__',
                                    '__le__', '__ge__'):
@@ -2106,12 +2091,7 @@ class PropertyScope(Scope):
 
     is_property_scope = 1
 
-    def declare_pyfunction(self, name, pos, allow_redefine=False):
-        binding = self._WTK_setup(name, name, visibility='private')
-        return self.WTK_declare_pyfunction(binding, allow_redefine, pos = pos)
-
-    def WTK_declare_pyfunction(self, binding,
-                              allow_redefine=False, pos=None):
+    def declare_pyfunction(self, binding, allow_redefine=False, pos=None):
         # Add an entry for a method.
         signature = get_property_accessor_signature(binding.name)
         if signature: