Issue1577969
Created on 2006-10-16.07:32:52 by neoedmund, last changed 2006-11-20.01:47:28 by cgroves.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2006-10-16 07:32:52 | neoedmund | create | |
Created on 2006-10-16.07:32:52 by neoedmund, last changed 2006-11-20.01:47:28 by cgroves.
| Messages | |||
|---|---|---|---|
| msg1266 (view) | Author: neo (neoedmund) | Date: 2006-10-16.07:32:52 | |
I have a small program which make me like python very
much, run well in python2.4(also 2.5),
but fail to run in Jython(jythonRelease_2_2alpha1).
[code]
class C1(object):
def v(self, o):
return "expected "+o
class C2(object):
def m(self):
print self.v("aaa")
class C3(object):pass
from types import MethodType
def addMethod(obj, meth):
f = meth.im_func
setattr(obj, f.__name__, MethodType(f,obj))
def test1():
o = C3()
addMethod(o, C2.m)
addMethod(o, C1.v)
o.m()
test1()
print C1.v.im_func(None,"xxx")
[/code]
> jython.bat d:\neo\py\oop.py
Traceback (innermost last):
File "d:\neo\py\oop.py", line 24, in ?
File "d:\neo\py\oop.py", line 19, in test1
File "d:\neo\py\oop.py", line 15, in addMethod
TypeError: _new_impl(): expected 3 args; got 2
|
|||
| msg1267 (view) | Author: Charlie Groves (cgroves) | Date: 2006-11-20.01:47:28 | |
This is fixed in svn and will be in the forthcoming beta. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2006-10-16 07:32:52 | neoedmund | create | |
Supported by Python Software Foundation,
Powered by Roundup