After updating PyCharm to 2017.1, a new inspection warning started to pop up in a place where everything's seemingly simple and correct. It looks as following: It looks like open() doesn't return the expected type for file parameter, but the code is pretty straightforward and, most importantly, does work as expected (using Python 3.5.2). Python docs mention a way using StringIO and it removes the warning indeed, but is it the correct pythonic way to specify output stream for print? If so, why? Is this warning important to follow? Continue reading...