Got an odd one.
I was trying to set up a script transform to essentially check the data type of a parameter, and output one of two strings based on the result. It was behaving oddly, and I managed to isolate it down to something I simply can't explain.
I reduced my script transform to:
if True:
return 'yes'
else:
return 'no'
Then I toggle it between if True
and if False
and it should return either yes
or no
.
If I type that out, that's exactly how it behaves. But if I copy and paste in the following:
if True:
return 'yes',
else:
return 'no'
...which appears to be identical, it doesn't return yes
or no
, it returns [yes]
or no
. That is, the first value returned is a single element array.
Try it yourself. Copy and paste the top code block into a script transform, and it'll return yes
. Copy and paste the bottom code block into a script transform, and it'll return [yes]
What the heck is going on here?
View.zip (3.5 KB)