|
Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in cl: msg#00052python.pyrex
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): pass C.ord = new.instancemethod(ord, None, C) c = C("a") print c.ord() -- Greg -- http://mail.python.org/mailman/listinfo/python-list |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: pyrex functions to replace a method (Re: replace a method in class: how?): 00052, Lenard Lindstrom |
|---|---|
| Previous by Thread: | Re: pyrex functions to replace a method (Re: replace a method in class: how?)i: 00052, Lenard Lindstrom |
| Next by Thread: | Re: pyrex functions to replace a method (Re: replace a method in class: how?): 00052, Stefan Behnel |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |