Non-atomic state file write

Code reviewMedium18 min

Your task

Review this Python function that updates a state file consumed by another process.