From: <bc...@wo...> - 2000-12-05 17:40:55
|
[Chris Knight] >all, I'm curious how I would define argument keywords for Java methods so >that Jython code can pass keyword arguments to it. You define a java method with a signature exactly like this: public void foo(PyObject[] args, String[] kws) { } The first elements of args are the positional arguments and the last kws.length elements of args are keyword argument values with the keyword names in kws. There are also an experimental ArgParser class that helps out with interpreting these two parameters. Look at the org/python/modules/sre/ PatternObject.java source for examples. >Additionally, I'm wondering if it would be worthwhile to start an advanced >developer's guide/FAQ? I would rather keep it all in the current FAQ. That way I don't have to decide when a topic is advanced. >Such topics could include: > >* Java classes that support PyList and PyDictionary mechanisms >* Java classes that support __call__/invoke mechanisms These questions would fit nicely under section 5. "Extending Jython." http://jython.sourceforge.net/cgi-bin/faqw.py?req=add regards, finn |