Issue1228217

classification
Title: Fix for bug [ 1222877 ] duplicate keyword arguments
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: archon55, bzimmer
Priority: normal Keywords: patch

Created on 2005-06-27.12:53:36 by archon55, last changed 2005-07-04.18:35:28 by bzimmer.

Files
File name Uploaded Description Edit Remove
pycomplex_dup_keywords.diff.txt archon55, 2005-06-27.12:53:36 Diff file for PyComplex.java
Messages
msg2455 (view) Author: Mike_G (archon55) Date: 2005-06-27.12:53:36
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)
>>>
msg2456 (view) Author: Brian Zimmer (bzimmer) Date: 2005-07-04.18:35:28
Logged In: YES 
user_id=37674

This works for me already on tip.
History
Date User Action Args
2005-06-27 12:53:36archon55create