From: W. Trevor King Date: Fri, 4 Mar 2011 01:59:47 +0000 (-0500) Subject: Normalize WTK_declare_pyfunction -> declare_pyfunction. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6500ba9fb22541b69a4b68fd5f627b100d40663f;p=cython.git Normalize WTK_declare_pyfunction -> declare_pyfunction. --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 188f787e..8e18658e 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -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) diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 4f71846f..16ec4938 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -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: