[Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

Alan Gauld alan.gauld at btinternet.com
Wed May 6 02:02:27 CEST 2009


"wesley chun" <wescpy at gmail.com> wrote 

> does anyone have the idiom for the above isinstance() check for 3.x?

Test for io.stream (or a derivative) - which is what open now returns.
files are no more...

Alan G.



More information about the Tutor mailing list