snoopyjc / pythonizer

Automatic translator from Perl to Python
https://snoopyjc.org/pythonizer/
Artistic License 2.0
12 stars 1 forks source link

Referencing an array element that doesn't exist shouldn't create it #359

Closed snoopyjc closed 1 year ago

snoopyjc commented 1 year ago

Referencing an array element that doesn't exist shouldn't create it. For example (from Date::Manip::Obj):

@arr = ();

$r = $arr[0];
assert(!defined $r);
assert(scalar(@arr) == 0);
snoopyjc commented 1 year ago

Fixed in v1.030