pythonizer
pythonizer copied to clipboard
Incorrect code for shift/pop of an empty array
In perl, a shift/pop on an empty list returns undef. The python generated code raises an exception. Example for optional arguments:
$thresh = shift;
$thresh = 1000
unless defined $thresh;
Fix is to generate:
thresh=perl_arg_array.pop(0) if perl_arg_array else None
if not (thresh != None):
thresh=1000
Fixed in https://github.com/snoopyjc/pythonizer