Re: Check if variable is an instance of a File object

2006-09-15 Thread sc_wizard29
Thanks for your help peter ! -- http://mail.python.org/mailman/listinfo/python-list

Re: Check if variable is an instance of a File object

2006-09-15 Thread sc_wizard29
Marc 'BlackJack' Rintsch a ecrit : > And what do you do if you check for `file` and it isn't such an instance? > Raise an exception? A no, that's something you don't like. So what else? > ;-) Well, I prefer the idea of raising my *own* exception to the idea of having an unknown behavior occu

Check if variable is an instance of a File object

2006-09-15 Thread sc_wizard29
Hi everyone, Maybe these questions will sound strange to you, but I sometime have a hard time switching from Java to Python ;-) Let's say I have a function like this : def show_lines(file): for next_line in file: ... What can I do to be sure that the input argument is in

Questions on exceptions

2006-08-21 Thread sc_wizard29
Hi everyone, I've just finished studying O'Reilly's "Learning python" and since I come from the Java world, there are some things that bother me concerning python's exception handling. In Java, all methods must declare the exceptions throwed (I'm speaking of checked exceptions)... but this is not