From: SourceForge.net <no...@so...> - 2007-09-28 04:39:38
|
Bugs item #1802626, was opened at 2007-09-26 11:13 Message generated for change (Comment added) made by rajesh_battala You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1802626&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Weatherman (thomas_meister) Assigned to: Nobody/Anonymous (nobody) Summary: list and tuple multiplication Initial Comment: Hi, I found a bug (maybe you see it a feature) in the handling of negative values when using lists and tuples. If I use a string, then an empty string is returned: > "0" * (-1) "" If I use a list or a tuple, then a runtime exception happens > [0] * (-1) java.lang.NegativeArraySizeException > (0,) * (-1) java.lang.NegativeArraySizeException Note: CPython returns an empty list or empty tuple instead. I found this bug/inconsistency when I tried to import decimal.py python source. Thank you in advance, Greetings Weatherman ---------------------------------------------------------------------- Comment By: rajesh battala (rajesh_battala) Date: 2007-09-28 04:39 Message: Logged In: YES user_id=1851210 Originator: NO hi Weatherman.. i ve lookeda at your comment. but looks its working fine .. try with the new build. it will work. Jython 2.3a0 on java1.5.0 Type "copyright", "credits" or "license" for more information. >>> "0"*(-1) '' >>> [0]*(-1) [] >>> (0,)*(-1) () >>> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1802626&group_id=12867 |