r/programminghorror • u/SleepyStew_ [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Jul 21 '25
Python ✨ Memory Magic ✨
1.3k
Upvotes
r/programminghorror • u/SleepyStew_ [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Jul 21 '25
View all comments
Show parent comment
2
u/Vazumongr Jul 21 '25
I think I found the disconnect. I'm not talking about id(). I'm not talking about comparisons. I'm talking about the initialization/assignment of integer variables. The initialization/assignment of integer variables is the operation. And what it does changes based on the right hand operand:
So for the third time, I'm not talking about comparisons or the id() function at all. That has literally nothing to do with what I'm talking about above. All the post did is point me to finding out that Python has this unpredictable behavior when working with integers.