Some classes are more about the skills than the material. For example, I was once a TA for astronomy 1, despite never having taken astronomy -- but I knew the math, physics, problem solving, etc., and so the actual "content" was trivial for me to pick up. I do not know what this class may be, but if you are a grad student in CS and this is an undergraduate CS class, it may be similar in that you already know how the "big ideas" and how to program, so it will be trivial to learn the course-specific content.
Being a TA can be more efficient. I assume the alternative is (a) TAing a different course, where you would learn nothing, and (b) taking this as a class, which would require doing the learning and the homework. Combining these into one activity could save nearly 50% of your effort.
Of course, you do have an ethical obligation to your students to be informed. Your graduate-level experience in this field combined with reading ahead will put you head and shoulders above freshman/sophomore students, even if you're not an expert in this particular course material. Conversely, if this is an honors course for senior CS students (for example), then it does seem unlikely that you would be able to offer them much guidance.