n C:\jython22a\jython: "C:\Program Files\TortoiseCVS\cvs.exe" "-q" "--lf" "diff" "-u" "-r" "2.13" "org/python/core/PyComplex.java" CVSROOT=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/jython cvs diff: Empty password used - try 'cvs login' with a real password Index: org/python/core/PyComplex.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyComplex.java,v retrieving revision 2.13 diff -u -r2.13 PyComplex.java --- org/python/core/PyComplex.java 20 Jun 2005 17:12:13 -0000 2.13 +++ org/python/core/PyComplex.java 27 Jun 2005 12:36:30 -0000 @@ -5,6 +5,8 @@ * A builtin python complex number */ +import java.util.*; + public class PyComplex extends PyObject { public double real, imag; @@ -15,9 +17,9 @@ public static final String exposed_name="complex"; public static void typeSetup(PyObject dict,PyType.Newstyle marker) { - dict.__setitem__("imag",new PyGetSetDescr("imag",PyComplex.class,"getImag",null)); - dict.__setitem__("real",new PyGetSetDescr("real",PyComplex.class,"getReal",null)); - class exposed___abs__ extends PyBuiltinFunctionNarrow { + dict.__setitem__("imag",new PyGetSetDescr("imag",PyComplex.class,"getImag",null)); + dict.__setitem__("real",new PyGetSetDescr("real",PyComplex.class,"getReal",null)); + class exposed___abs__ extends PyBuiltinFunctionNarrow { private PyComplex self; @@ -970,9 +972,12 @@ throw Py.TypeError("complex() "+"takes at most 2 arguments (" + args.length + " given)"); - // optimize complex(int, int) here? + if (args.length == 2 && keywords[0].equals(keywords[1])) + throw Py.SyntaxError("duplicate keyword argument."); - ArgParser ap = new ArgParser("complex", args, keywords, "real", "imag"); + + // optimize complex(int, int) here? + ArgParser ap = new ArgParser("complex", args, keywords, "real", "imag"); PyObject real = ap.getPyObject(0, Py.Zero); PyObject imag = ap.getPyObject(1, null);