Much better than 4o, in my experience. I've stopped using 4o almost completely, except for cases where I need good tooling more than I need good performance (PoCs and the like).
They both produce garbage code in this solution. Claude versions is just 20% less garbage, but still useless. The code mixes those two, even if i specify i want the python3 version or directly specifying a version.