Go offers this out of the box via the sync.Once function. Do other languages? Kind of surprised python doesn’t as this sort of pattern is common in applications dealing with concurrency
> Kind of surprised python doesn’t as this sort of pattern is common in applications dealing with concurrency
Well yeah, python was not designed for that.
[0] https://developer.apple.com/documentation/dispatch/1447169-d...
the good thing with go's sync.Once is that it's implemented as a library instead of something in the language itself, so it's easy for curious user to see how it's actually implemented. they even have comments there pointing out wrong implementations, which I have seen people make the exact same mistake during code reviews (in other language).