Open snoopyjc opened 2 years ago
Regex's in a list context with groups produces incorrect code. For example:
@ymd = $file =~ /^(\d{4})(\d{2})(\d{2})$/;
Generates:
ymd=(default_match:=re.match('^(\d{4})(\d{2})(\d{2})$',file))
And it should generate:
ymd=(default_match:=re.match('^(\d{4})(\d{2})(\d{2})$',file),default_match.groups() if default_match else [])[1]
Fixed in https://github.com/snoopyjc/pythonizer
Regex's in a list context with groups produces incorrect code. For example:
Generates:
And it should generate: