I have to do a very simple project in python where I add error checking to the built in file class. So far, I've got:
class RobustFile(file):
def __init__(self,name,mode):
file.__init__(self,name,mode)
I'm just starting out, but to make sure I hadn't messed anything up, I ran it. Well, right off the bat, I raised a NameError because it didn't recognize file. I tried tweaking it, I looked it up on the internet, I copied examples using the same format, and...all NameError. Can anyone shed some light on how exactly to subclass file?