This isn't really a duplicate of Posting a suggestion when I'm not sure about the answer, but it's quite similar.
In one of my current questions a comment has led me to improve my code as stated in the question. The comment in question suggests one possible issue with my current code, and a follow-up comment suggest a way to test the issue. Based on both, I now have updated code which passes that test.
If another person were to post my (now updated) code as an answer, I would be happy with the help, but would not accept it as an answer as the overarching question of 'global' and 'testability' is not yet really answered. This indicates that it is at least possible that my updated code should be posted to my own question as an answer.
Alternatively I could edit my initial question. As it's a new question with no answers yet I think that's fairly undestructive, but I'm unsure as to the semantics of what a significant modification to the question is for/would achieve.