Message2455

Author archon55
Recipients
Date 2005-06-27.12:53:36
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
PyComplex method complex_new was not checking for
keyword arguments making it possible to do:
  complex(imag=3,imag=4) or
  complex(real=5, real=7)

This fix eliminates this by throwing a SyntaxError like
Python.

>>> complex(imag=4,imag=3)
Traceback (innermost last):
  File "<console>", line 1, in ?
  File "None", line None
SyntaxError: duplicate keyword argument.
>>> complex(real=4,real=3)
Traceback (innermost last):
  File "<console>", line 1, in ?
  File "None", line None
SyntaxError: duplicate keyword argument.
>>> complex(imag=4)
4j
>>> complex(real=4)
(4+0j)
>>> complex(real=4,imag=98)
(4+98j)
>>>
History
Date User Action Args
2008-02-20 17:18:29adminlinkissue1228217 messages
2008-02-20 17:18:29admincreate