Index: ArgParser.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/ArgParser.java,v retrieving revision 1.7 diff -u -r1.7 ArgParser.java --- ArgParser.java 23 Feb 2005 04:26:21 -0000 1.7 +++ ArgParser.java 27 Feb 2005 15:31:52 -0000 @@ -169,7 +169,7 @@ } /** - * Return an optiona argument as a PyObject. + * Return an optional argument as a PyObject. * @param pos The position of the argument. First argument is * numbered 0. */ @@ -197,14 +197,20 @@ private void check() { + int nargs = args.length - kws.length; l1: for (int i = 0; i < kws.length; i++) { for (int j = 0; j < params.length; j++) { - if (kws[i].equals(params[j])) + if (kws[i].equals(params[j])) { + if (j < nargs) { + throw Py.TypeError("keyword parameter '" + params[j] + + "' was given by position and by name"); + } continue l1; + } } - throw Py.TypeError(kws[i] + " is an invalid keyword argument " + - "for this function"); + throw Py.TypeError("'" + kws[i] + "' is an invalid keyword " + + "argument for this function"); } } Index: PyBuiltinFunctionWide.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyBuiltinFunctionWide.java,v retrieving revision 2.1 diff -u -r2.1 PyBuiltinFunctionWide.java --- PyBuiltinFunctionWide.java 22 Feb 2005 04:19:30 -0000 2.1 +++ PyBuiltinFunctionWide.java 27 Feb 2005 15:31:52 -0000 @@ -45,8 +45,8 @@ throw info.unexpectedCall(args.length,true); } return inst_call(self,args); - } - + } + abstract public PyObject inst_call(PyObject self, PyObject[] args); public PyObject __call__(PyObject[] args, String[] keywords) {