Re:Show HN: Change Python code while it's running using a re...
by _carl_jung on Friday October 18, 2019 @07:59AM
(#21290560)
This is awesome. A nice improvement would be to have the loop continue with the old code when there are errors (rather than pausing iteration).
[ Parent
| on HN ]
Re:Show HN: Change Python code while it's running using a re...
by rcfox on Friday October 18, 2019 @01:15PM
(#21293175)
That seems like it would be confusing. Imagine trying to track down the source of behaviour that no longer exists in your code...
Re:Show HN: Change Python code while it's running using a re...
by ianai on Friday October 18, 2019 @08:09AM
(#21290631)
How would that be possible without having to essentially keep track of two files? Nice idea though.
Re:Show HN: Change Python code while it's running using a re...
by earenndil on Friday October 18, 2019 @10:51AM
(#21291864)
Basically, you just need a double buffer system:
- Always run from the back buffer
- Always scan the updated file into the front buffer
- If the front buffer is fresh AND the front buffer contains no bugs, bufferswap