Likely a post for a separate thread, but I find the instructions incredibly vague.
"Create a custom set type.
Sometimes it is necessary to define a custom data structure of some type, like a set. In this exercise you will define your own set. How it works internally doesn’t matter, as long as it behaves like a set of unique elements."
We never explain what a set is and tell you to implement it without saying how one works. I know the test suite is the source of truth for what your implementation needs to do, but if I didn’t know what a set was beforehand, I’d be pretty lost.
If we specify which behavior to use, we should also test to ensure that behavior is followed.
If we follow the semantics of Python’s builtin set, then set.add() would mutate the set and would not return a set. It would be easy to test for a mutation by ignoring the return value.
If we follow the pattern of the other operations (union, intersection, difference), the set should not be mutated.
Is one clearly more correct than the other? If not, is there any reason to limit the implementation? It can make for a good mentor discussion topic either way.
Re: description, that’s a problem spec discussion, not a GDScript discussion The description could benefit from a rewrite (ideally with an intro and instruction) … but not in this category.
Could the analyzer pick up on whether the set is mutable and suggest making it immutable (or vice versa if we go that way)? Leaving it for a mentoring discussion is fine, but more people would potentially see the analyzer feedback than do a mentoring discussion.
…probably. The analyzer isn’t yet live so I haven’t yet looked into building custom reports. But if one approach isn’t more correct than the other, why would we suggest using one over the other?