|
Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in cl: msg#00046python.pyrex
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 use a built-in function as a method. 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 because Pyrex pre-wraps a function defined in a class in an unbound method object before putting it in the class. 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. -- Greg -- http://mail.python.org/mailman/listinfo/python-list |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | pyrex functions to replace a method (Re: replace a method in class: how?): 00046, Brian Blais |
|---|---|
| Next by Date: | Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in class: how?): 00046, Brian Blais |
| Previous by Thread: | pyrex functions to replace a method (Re: replace a method in class: how?)i: 00046, Brian Blais |
| Next by Thread: | Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in class: how?): 00046, Brian Blais |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |