I'm working on LeetCode 78. Subsets and found this interesting error. If I change the marked line to the commented line, such an error will be thrown out.
I announced "res" in the outer function, why is res.append() different from res += ? I know += is more like .extend() but that is not the conflict here. What caused the reference error?