It's thread-safe in the sense that it doesn't really matter if two threads hit the race condition between checking and getting the languages. In the worst scenario, thread 1 and thread 2 hit this "simultaneously", both evaluate that line to True, then both get the languages. Then one of them will stomp on the other. But it's the same set of languages, so it doesn't matter which comes out on top.