Used to 'file = open(...)', now what?

Skip Montanaro skip at pobox.com
Wed May 7 17:08:49 EDT 2003


    Grzegorz> I'm very used to the following construct:
    Grzegorz>   file = open("whatever", flags)
    Grzegorz>   buf = file.readlines()
    Grzegorz>   file.close()

    Grzegorz> But with Python 2.2 file() is a builtin constructor, making
    Grzegorz> open deprecated, possibly dropped in a future version. Now
    Grzegorz> what would be the "usual" way to name file variables without
    Grzegorz> hiding the constructor?

Oh, I don't know, pick another variable name?  How about 'i'?  :-)

implicit-integer-ly, y'rs,

Skip





More information about the Python-list mailing list