Search code examples
pythonpython-3.xpycharmset

Why does PyCharm has different output in 'Run' and 'Debug'?


I have a problem with set(). This code has different output in 'Run' and in 'Debug'.

n = set(input()) #input - 3490
m = set(input()) #input - 9340
if n == m:
    print(True)
else:
    print(False)

Run - False, Debug - True. I can't understand why this is happened. Please help Python 3.10


Solution

  • That's a regression in PyCharm 2022.1.1. It handles STDIN incorrectly during the Run hence the difference. https://youtrack.jetbrains.com/issue/PY-54238/STDIN-is-lost-for-a-second-input-call

    Update to 2022.1.2 RC (release candidate) where the problem is resolved