From: Oti <oh...@ya...> - 2004-10-05 12:29:24
|
--- Samuele Pedroni <ped...@bl...> wrote: > it seems related to the problem that package private classes with > public > methods confuse Jython 2.1. > > invoking this code before using StringBuffer (once per program (not > per > import) is enough), seems to workaround the problem: > > import java > import org.python.core > > import java.lang.StringBuffer as SB > > for n,f in java.lang.AbstractStringBuilder.__dict__.items(): > x = org.python.core.PyReflectedFunction(n) > for a in f.argslist: > if a is None: continue > m = SB.getMethod(n,a.args) > x.addMethod(m) > SB.__dict__[n] = x This works perfectly. Thanks a LOT for the quick response! Oti. |