simple error i hope

Maric Michaud maric at aristote.info
Sat Aug 2 08:28:28 CEST 2008


Le Saturday 02 August 2008 00:51:50 Clay Hobbs, vous avez écrit :
> It is also a good idea to open files with the open() function and not the
> file() function.  They do the exact same thing, and take the exact same
> parameters, just open() makes your code a bit more readable (or at least
> that's what I think).

The main point with open I think is to easy later evolution. While you could 
override "file" name as well as "open" by a custom funcion, it's a bad idea 
to override the name of the type because a simple isinstance(file_, file) 
won't work anymore if you do so.


-- 
_____________

Maric Michaud



More information about the Python-list mailing list