pythonizer icon indicating copy to clipboard operation
pythonizer copied to clipboard

Array assignments to a list of scalars raise exceptions on mismatches

Open snoopyjc opened this issue 3 years ago • 1 comments

Array assignments to a list of scalars raise exceptions on mismatches. In perl they silently copy over as many elements as they can and fill in the rest with undef if need be. Mimic this behavior in the generated code. For example:

my @arr = ('a', 'b', 'c');
($thing1, $thing2) = @arr;   # copy over the first 2 things
($t1, $t2, $t3, $t4) = @arr;   # copy over the 3 elements - $t4 is undef

snoopyjc avatar Nov 20 '21 22:11 snoopyjc

Fixed in https://github.com/snoopyjc/pythonizer

snoopyjc avatar Feb 07 '22 16:02 snoopyjc