In the following python code, what causes the difference in outputs?
try:
open('nonexistent')
except Exception as err:
print(f'{err=}')
print(f'{err}')
result:
err=FileNotFoundError(2, 'No such file or directory')
[Errno 2] No such file or directory: 'nonexistent'
In this instance, the second is more useful, but I'm surprised there's a difference at all. What's the cause of this, and what's the logic behind this design decision?
I'm using Python 3.8.3.