Greg Ewing [EMAIL PROTECTED] writes on Wed, 28 Jun 2006 11:56:55 +1200:
...
I have suggested that builtin functions should be
given the same method-binding behaviour as interpreted
functions. The idea wasn't rejected out of hand, but
I don't think anything has been done about it yet.
You can
Greg Ewing wrote:
Brian Blais wrote:
I have found a very similar problem trying to replace a method using a
function defined in pyrex.
Functions defined in Pyrex are C-implemented functions,
which don't trigger the method binding magic when you
access them through a class. The same
Greg Ewing wrote:
Brian Blais wrote:
I have found a very similar problem trying to replace a method using a
function defined in pyrex.
What *should* work is to define the method inside a
class in Pyrex (plain class, not extension type) and
extract it out of the class's __dict__. That's
Hi Brian,
Brian Blais wrote:
import module_py # import a function from a python module
import module_pyrex # import a function from a pyrex extension module
class This(object):
def update1(self,val):
print val
def update2(self,val):
print 2,val
Brian Blais wrote:
Greg Ewing wrote:
Brian Blais wrote:
I have found a very similar problem trying to replace a method using a
function defined in pyrex.
What *should* work is to define the method inside a
class in Pyrex (plain class, not extension type) and
extract it out of the
On 28 Jun 2006 at 7:02, Brian Blais wrote:
Greg Ewing wrote:
Brian Blais wrote:
I have found a very similar problem trying to replace a method using a
function defined in pyrex.
What *should* work is to define the method inside a
class in Pyrex (plain class, not extension type)
Brian Blais wrote:
TypeError: unbound method pyrex_update_within_class() must be called
with update_funcs instance as first argument (got str instance instead)
Hm. Okay, so that doesn't work either.
But I just tried the following, and it seems
to work:
import new
class C(str):
Brian Blais wrote:
I have found a very similar problem trying to replace a method using a
function defined in pyrex.
Functions defined in Pyrex are C-implemented functions,
which don't trigger the method binding magic when you
access them through a class. The same thing happens if
you try to