I just created a new environment with Python 3.10, and I had a piece of code that runs different algorithms, and prints which one is working on in the same line, until it moves to a new product. It was working fine with Python 3.9.12.
The code is quite simple:
print('Product '+ prod + ' - algorithm: ', end='')
# some code
print('Arima ', end='')
# some code running Arima
print('Prophet ', end='')
# some code running Prophet
print('')
The result was something like:
Product A - algorithm:
and a few seconds later:
Product A - algorithm: Arima
and a few seconds later:
Product A - algorithm: Arima Prophet
(just adding 'Prophet' to the previous line)
and a few seconds later, in a new line:
Product B - algorithm: Arima
Now, with Python 3.10.6, I don't see anything until the fourth 'print' command occurs, so it takes a few seconds without any printing, and then it prints all together after all code above has run.
It was very useful to see which algorithm the code was in (I have 5 algorithms), rather than having to wait until all 5 are done to see the printed line in the terminal.
Any clue why Python 3.10.6 would have changed the behaviour? By the way, if I run it in debug mode, then the printing happens as expected! Go figure...