Message828

Author nobody
Recipients
Date 2003-04-30.08:34:29
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The the new module can be used to create unbound mothod
objects, but this doesn't work with the current jython
implementations.

import new
class C: pass
def a(self): pass
C.a = new.instancemethod( a, None, C )
print str( C.a )

prints

  <method C.null of org.python.core.PyNone instance at
32058896>

expected output (cpython) 

  <unbound method C.a>

The problem is a missing check for Py.None, either in
org.python.modules.newmodule or in
org.python.core.PyMethod
I consider org.python.core.PyMethod the right place,
because
None may never have any instance methods.

Attached is a patch against the current CVS version of 
org.python.core.PyMethod.

Many thanks for jython.
  Anselm Kruis

A.Kruis@science-computing.de

History
Date User Action Args
2008-02-20 17:17:14adminlinkissue730082 messages
2008-02-20 17:17:14admincreate