Another possibility: class NoFile: def close(self): pass f = NoFile() g = NoFile() h = NoFile() try: # stuff that opens f, g and/or h finally: f.close() g.close() h.close() -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg