Issue1345

classification
Title: Can't initialise int[] property with tuple
Type: crash Severity: normal
Components: Core Versions: 2.5.1
Milestone:
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: petegibson, pjenvey, zyasoft
Priority: normal Keywords: RFE

Created on 2009-05-13.01:58:23 by petegibson, last changed 2009-05-31.05:36:15 by pjenvey.

Messages
msg4678 (view) Author: Peter Gibson (petegibson) Date: 2009-05-13.01:58:23
I get an error when initializing a property that expects an int[] using
a tuple (in 2.5rc2):

Traceback:
    File <blah>, line 176, in init_sash_form
    self.sash_form.weights = (30, 70)

    TypeError: No visible constructors for class ([I)


Prototype for property weights:
     void     setWeights(int[] weights) 

However, there are no problems when using a list instead.
msg4717 (view) Author: Jim Baker (zyasoft) Date: 2009-05-23.21:02:36
This seems like a candidate for additional unification of list/tuple.
Also int[] is more like a tuple than a list.
msg4769 (view) Author: Philip Jenvey (pjenvey) Date: 2009-05-31.05:31:26
This is arguably not a bug as the tuple is specially handled for java 
properties:

http://www.jython.org/Project/userguide.html#tuples

We couldn't treat tuples as anything mutable anyway
msg4770 (view) Author: Philip Jenvey (pjenvey) Date: 2009-05-31.05:36:02
Well, I guess we *could*, but it sounds a bit odd to me. It'd be making an 
assignment operation create a mutable copy of an immutable object
History
Date User Action Args
2009-05-31 05:36:15pjenveysetmessages: + msg4770
2009-05-31 05:31:46pjenveysetstatus: open -> closed
resolution: invalid
messages: + msg4769
nosy: + pjenvey
2009-05-23 21:03:13zyasoftsetpriority: normal
2009-05-23 21:02:46zyasoftsetversions: + 2.5.1
2009-05-23 21:02:36zyasoftsetkeywords: + RFE
nosy: + zyasoft
messages: + msg4717
2009-05-13 01:58:23petegibsoncreate