Bruno Desthuilliers wrote:
> [EMAIL PROTECTED] wrote:
> > #1 : should I start by checking that 'file' is indeed an instance of a
> > File object ?
>
> Unless you have a *very* compelling reason to do so (and I can't imagine
> one here), definitively, no. FWIW, it's pretty common in Python to pass
[EMAIL PROTECTED] wrote:
> 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 d
[EMAIL PROTECTED] wrote:
> 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
[EMAIL PROTECTED] wrote:
> 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:
> ...
OT : this wi
Thanks for your help peter !
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
>
> 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 i
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
On 15 Sep 2006 00:18:14 -0700, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> 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 nex
In <[EMAIL PROTECTED]>, sc_wizard29
wrote:
> 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
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
10 matches
Mail list logo