Python variable is evaluated differently in pdb and print statements
问题 I am using threads in a python program and recently found a problem where a float is not being interpreted correctly and whenever I go to print it out in pdb or in a logging statement, it shows up correctly most of the time. Oddly, it takes a different amounts of prints to show up in these two threads I just ran. Also the first two prints use the same format, but the value still changes in thread 1. for x in imports: if float(x.prob) == 0.0: logging.debug(float(x.prob)) logging.debug(float(x